for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Overloads the relevant methods of the real ResultsWrapper so it
* doesn't go anywhere near an actual database.
*/
class FakeResultWrapper extends ResultWrapper {
/** @var $result stdClass[] */
* @param stdClass[] $rows
function __construct( array $rows ) {
parent::__construct( null, $rows );
}
function numRows() {
return count( $this->result );
function fetchRow() {
if ( $this->pos < count( $this->result ) ) {
$this->currentRow = $this->result[$this->pos];
} else {
$this->currentRow = false;
false
object<stdClass>|null
$currentRow
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..
$this->pos++;
if ( is_object( $this->currentRow ) ) {
return get_object_vars( $this->currentRow );
return $this->currentRow;
function seek( $row ) {
$this->pos = $row;
function free() {
function fetchObject() {
$this->fetchRow();
if ( $this->currentRow ) {
return (object)$this->currentRow;
return false;
function rewind() {
$this->pos = 0;
$this->currentRow = null;
function next() {
return $this->fetchObject();
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..