for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Soluble\DbWrapper\Result;
class Resultset implements ResultInterface
{
/**
*
* @var integer
*/
protected $position = 0;
protected $count = 0;
* @var array
protected $storage=[];
public function __construct()
$this->storage = [];
$this->position = 0;
$this->count = count($this->storage);
}
* {@inheritdoc}
public function current()
return $this->storage[$this->position];
* @return int position
public function key()
return $this->position;
public function next()
++$this->position;
public function rewind()
$this->position=0;
public function valid()
return isset($this->storage[$this->position]);
public function count()
return $this->count;
public function append(array $row)
$this->storage[] = $row;
++$this->count;
public function offsetExists($position)
return isset($this->storage[$position]);
public function offsetGet($position)
return isset($this->storage[$position]) ? $this->storage[$position] : null;
public function offsetSet($position, $row)
throw new \Exception('Resultsets are immutable');
public function offsetUnset($position)
throw new \Exception("Resultsets are immutable");
* @return array
public function getArray()
return $this->storage;