for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Phile\Repository;
/**
* Page collection which delays searching for and loading pages until necessary.
*
* @author PhileCMS
* @link https://philecms.com
* @license http://opensource.org/licenses/MIT
* @package Phile\Repository
*/
class PageCollection implements \ArrayAccess, \IteratorAggregate, \Countable
{
* @var callback A function to be used for loading the pages.
private $loader;
* @var array of \Phile\Model\Page
private $pages;
* Constructor.
* @param callable $loader pages loader
public function __construct(callable $loader)
$this->loader = $loader;
}
* Perform page loading.
* @return void
private function load()
if ($this->pages === null) {
$this->pages = call_user_func($this->loader);
call_user_func($this->loader)
array
$pages
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..
* Get pages in a array.
* @return array of \Phile\Model\Page
public function toArray()
$this->load();
return $this->pages;
public function getIterator()
return new \ArrayIterator($this->pages);
public function offsetExists($offset)
return isset($this->pages[$offset]);
public function offsetGet($offset)
return $this->pages[$offset];
public function offsetSet($offset, $value)
$this->pages[$offset] = $value;
public function offsetUnset($offset)
unset($this->pages[$offset]);
public function count()
return count($this->pages);
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..