Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge branch 'cs/remove-underscores' of https://github.com/arse/zf2 i…
Browse files Browse the repository at this point in the history
…nto feature/protected-underscores

Conflicts:
	library/Zend/Console/Getopt.php
  • Loading branch information
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 125 deletions.
12 changes: 6 additions & 6 deletions src/Adapter/ArrayAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ class ArrayAdapter implements AdapterInterface
*
* @var array
*/
protected $_array = null;
protected $array = null;

/**
* Item count
*
* @var integer
*/
protected $_count = null;
protected $count = null;

/**
* Constructor.
Expand All @@ -37,8 +37,8 @@ class ArrayAdapter implements AdapterInterface
*/
public function __construct(array $array = array())
{
$this->_array = $array;
$this->_count = count($array);
$this->array = $array;
$this->count = count($array);
}

/**
Expand All @@ -50,7 +50,7 @@ public function __construct(array $array = array())
*/
public function getItems($offset, $itemCountPerPage)
{
return array_slice($this->_array, $offset, $itemCountPerPage);
return array_slice($this->array, $offset, $itemCountPerPage);
}

/**
Expand All @@ -60,6 +60,6 @@ public function getItems($offset, $itemCountPerPage)
*/
public function count()
{
return $this->_count;
return $this->count;
}
}
32 changes: 16 additions & 16 deletions src/Adapter/DbSelect.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ class DbSelect implements AdapterInterface
*
* @var \Zend\Db\Sql\Select
*/
protected $_countSelect = null;
protected $countSelect = null;

/**
* Database query
*
* @var \Zend\Db\Sql\Select
*/
protected $_select = null;
protected $select = null;

/**
* Total item count
*
* @var integer
*/
protected $_rowCount = null;
protected $rowCount = null;

/**
* Constructor.
Expand All @@ -53,7 +53,7 @@ class DbSelect implements AdapterInterface
*/
public function __construct(Sql\Select $select)
{
$this->_select = $select;
$this->select = $select;
}

/**
Expand Down Expand Up @@ -82,7 +82,7 @@ public function setRowCount($rowCount)
$countColumnPart = $countColumnPart->__toString();
}

$rowCountColumn = $this->_select->getAdapter()->foldCase(self::ROW_COUNT_COLUMN);
$rowCountColumn = $this->select->getAdapter()->foldCase(self::ROW_COUNT_COLUMN);

// The select query can contain only one column, which should be the row count column
if (false === strpos($countColumnPart, $rowCountColumn)) {
Expand All @@ -91,9 +91,9 @@ public function setRowCount($rowCount)

$result = $rowCount->query(Db\Db::FETCH_ASSOC)->fetch();

$this->_rowCount = count($result) > 0 ? $result[$rowCountColumn] : 0;
$this->rowCount = count($result) > 0 ? $result[$rowCountColumn] : 0;
} elseif (is_integer($rowCount)) {
$this->_rowCount = $rowCount;
$this->rowCount = $rowCount;
} else {
throw new Exception\InvalidArgumentException('Invalid row count');
}
Expand All @@ -110,9 +110,9 @@ public function setRowCount($rowCount)
*/
public function getItems($offset, $itemCountPerPage)
{
$this->_select->limit($itemCountPerPage, $offset);
$this->select->limit($itemCountPerPage, $offset);

return $this->_select->query()->fetchAll();
return $this->select->query()->fetchAll();
}

/**
Expand All @@ -122,13 +122,13 @@ public function getItems($offset, $itemCountPerPage)
*/
public function count()
{
if ($this->_rowCount === null) {
if ($this->rowCount === null) {
$this->setRowCount(
$this->getCountSelect()
);
}

return $this->_rowCount;
return $this->rowCount;
}

/**
Expand All @@ -146,11 +146,11 @@ public function getCountSelect()
* We only need to generate a COUNT query once. It will not change for
* this instance.
*/
if ($this->_countSelect !== null) {
return $this->_countSelect;
if ($this->countSelect !== null) {
return $this->countSelect;
}

$rowCount = clone $this->_select;
$rowCount = clone $this->select;
$rowCount->__toString(); // Workaround for ZF-3719 and related

$db = $rowCount->getAdapter();
Expand Down Expand Up @@ -182,7 +182,7 @@ public function getCountSelect()
* the original query and use it as a subquery os the COUNT query.
*/
if (($isDistinct && count($columnParts) > 1) || count($groupParts) > 1 || !empty($havingParts)) {
$rowCount = $db->select()->from($this->_select);
$rowCount = $db->select()->from($this->select);
} elseif ($isDistinct) {
$part = $columnParts[0];

Expand Down Expand Up @@ -224,7 +224,7 @@ public function getCountSelect()
->columns($expression);
}

$this->_countSelect = $rowCount;
$this->countSelect = $rowCount;

return $rowCount;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Adapter/DbTableSelect.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class DbTableSelect extends DbSelect
*/
public function getItems($offset, $itemCountPerPage)
{
$this->_select->limit($itemCountPerPage, $offset);
$this->select->limit($itemCountPerPage, $offset);

return $this->_select->getTable()->fetchAll($this->_select);
return $this->select->getTable()->fetchAll($this->select);
}
}
14 changes: 7 additions & 7 deletions src/Adapter/Iterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ class Iterator implements AdapterInterface
*
* @var Iterator
*/
protected $_iterator = null;
protected $iterator = null;

/**
* Item count
*
* @var integer
*/
protected $_count = null;
protected $count = null;

/**
* Constructor.
Expand All @@ -44,8 +44,8 @@ public function __construct(\Iterator $iterator)
throw new Exception\InvalidArgumentException('Iterator must implement Countable');
}

$this->_iterator = $iterator;
$this->_count = count($iterator);
$this->iterator = $iterator;
$this->count = count($iterator);
}

/**
Expand All @@ -57,10 +57,10 @@ public function __construct(\Iterator $iterator)
*/
public function getItems($offset, $itemCountPerPage)
{
if ($this->_count == 0) {
if ($this->count == 0) {
return array();
}
return new Paginator\SerializableLimitIterator($this->_iterator, $offset, $itemCountPerPage);
return new Paginator\SerializableLimitIterator($this->iterator, $offset, $itemCountPerPage);
}

/**
Expand All @@ -70,6 +70,6 @@ public function getItems($offset, $itemCountPerPage)
*/
public function count()
{
return $this->_count;
return $this->count;
}
}
6 changes: 3 additions & 3 deletions src/Adapter/Null.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Null implements AdapterInterface
*
* @var integer
*/
protected $_count = null;
protected $count = null;

/**
* Constructor.
Expand All @@ -30,7 +30,7 @@ class Null implements AdapterInterface
*/
public function __construct($count = 0)
{
$this->_count = $count;
$this->count = $count;
}

/**
Expand Down Expand Up @@ -59,6 +59,6 @@ public function getItems($offset, $itemCountPerPage)
*/
public function count()
{
return $this->_count;
return $this->count;
}
}

0 comments on commit ee4a022

Please sign in to comment.