diff --git a/src/Table/Column.php b/src/Table/Column.php index ef986c2..2eb55e6 100644 --- a/src/Table/Column.php +++ b/src/Table/Column.php @@ -32,28 +32,28 @@ class Column * * @var string */ - protected $_content = ''; + protected $content = ''; /** * Align of the column * * @var string */ - protected $_align = self::ALIGN_LEFT; + protected $align = self::ALIGN_LEFT; /** * Colspan of the column * * @var integer */ - protected $_colSpan = 1; + protected $colSpan = 1; /** * Allowed align parameters * * @var array */ - protected $_allowedAligns = array(self::ALIGN_LEFT, self::ALIGN_CENTER, self::ALIGN_RIGHT); + protected $allowedAligns = array(self::ALIGN_LEFT, self::ALIGN_CENTER, self::ALIGN_RIGHT); /** * Create a column for a Zend\Text\Table\Row object. @@ -112,7 +112,7 @@ public function setContent($content, $charset = null) } - $this->_content = $content; + $this->content = $content; return $this; } @@ -126,11 +126,11 @@ public function setContent($content, $charset = null) */ public function setAlign($align) { - if (in_array($align, $this->_allowedAligns) === false) { + if (in_array($align, $this->allowedAligns) === false) { throw new Exception\OutOfBoundsException('Invalid align supplied'); } - $this->_align = $align; + $this->align = $align; return $this; } @@ -148,7 +148,7 @@ public function setColSpan($colSpan) throw new Exception\InvalidArgumentException('$colSpan must be an integer and greater than 0'); } - $this->_colSpan = $colSpan; + $this->colSpan = $colSpan; return $this; } @@ -160,7 +160,7 @@ public function setColSpan($colSpan) */ public function getColSpan() { - return $this->_colSpan; + return $this->colSpan; } /** @@ -184,7 +184,7 @@ public function render($columnWidth, $padding = 0) throw new Exception\OutOfBoundsException('Padding (' . $padding . ') is greater than column width'); } - switch ($this->_align) { + switch ($this->align) { case self::ALIGN_LEFT: $padMode = STR_PAD_RIGHT; break; @@ -203,7 +203,7 @@ public function render($columnWidth, $padding = 0) } $outputCharset = Table::getOutputCharset(); - $lines = explode("\n", Text\MultiByte::wordWrap($this->_content, $columnWidth, "\n", true, $outputCharset)); + $lines = explode("\n", Text\MultiByte::wordWrap($this->content, $columnWidth, "\n", true, $outputCharset)); $paddedLines = array(); foreach ($lines AS $line) { diff --git a/src/Table/Row.php b/src/Table/Row.php index 6d6370d..ad2ee3a 100644 --- a/src/Table/Row.php +++ b/src/Table/Row.php @@ -25,14 +25,14 @@ class Row * * @var array */ - protected $_columns = array(); + protected $columns = array(); /** * Temporary stored column widths * * @var array */ - protected $_columnWidths = null; + protected $columnWidths = null; /** * Create a new column and append it to the row @@ -66,7 +66,7 @@ public function createColumn($content, array $options = null) */ public function appendColumn(Column $column) { - $this->_columns[] = $column; + $this->columns[] = $column; return $this; } @@ -81,11 +81,11 @@ public function appendColumn(Column $column) */ public function getColumn($index) { - if (!isset($this->_columns[$index])) { + if (!isset($this->columns[$index])) { return null; } - return $this->_columns[$index]; + return $this->columns[$index]; } /** @@ -95,7 +95,7 @@ public function getColumn($index) */ public function getColumns() { - return $this->_columns; + return $this->columns; } /** @@ -106,11 +106,11 @@ public function getColumns() */ public function getColumnWidths() { - if ($this->_columnWidths === null) { + if ($this->columnWidths === null) { throw new Exception\UnexpectedValueException('render() must be called before columnWidths can be populated'); } - return $this->_columnWidths; + return $this->columnWidths; } /** @@ -125,11 +125,11 @@ public function getColumnWidths() public function render(array $columnWidths, Decorator $decorator, $padding = 0) { // Prepare an array to store all column widths - $this->_columnWidths = array(); + $this->columnWidths = array(); // If there is no single column, create a column which spans over the // entire row - if (count($this->_columns) === 0) { + if (count($this->columns) === 0) { $this->appendColumn(new Column(null, null, count($columnWidths))); } @@ -137,7 +137,7 @@ public function render(array $columnWidths, Decorator $decorator, $padding = 0) $renderedColumns = array(); $maxHeight = 0; $colNum = 0; - foreach ($this->_columns as $column) { + foreach ($this->columns as $column) { // Get the colspan of the column $colSpan = $column->getColSpan(); @@ -155,7 +155,7 @@ public function render(array $columnWidths, Decorator $decorator, $padding = 0) $result = explode("\n", $column->render($columnWidth, $padding)); // Store the width of the rendered column - $this->_columnWidths[] = $columnWidth; + $this->columnWidths[] = $columnWidth; // Store the rendered column and calculate the new max height $renderedColumns[] = $result; @@ -173,7 +173,7 @@ public function render(array $columnWidths, Decorator $decorator, $padding = 0) $colNum)); $renderedColumns[] = array(str_repeat(' ', $remainingWidth)); - $this->_columnWidths[] = $remainingWidth; + $this->columnWidths[] = $remainingWidth; } // Add each single column line to the result @@ -185,7 +185,7 @@ public function render(array $columnWidths, Decorator $decorator, $padding = 0) if (isset($renderedColumn[$line]) === true) { $result .= $renderedColumn[$line]; } else { - $result .= str_repeat(' ', $this->_columnWidths[$index]); + $result .= str_repeat(' ', $this->columnWidths[$index]); } $result .= $decorator->getVertical();