for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the Composite Utils package.
*
* (c) Emily Shepherd <[email protected]>
* For the full copyright and license information, please view the
* LICENSE.md file that was distributed with this source code.
* @package spaark/composite-utils
* @author Emily Shepherd <[email protected]>
* @license MIT
*/
namespace Spaark\CompositeUtils\Model\Collection;
use Iterator;
* A trait which implements all of the methods required by the
* OuterIterator trait
* The default implementations simply pass through all requests onto
* the inner iterator.
trait OuterIteratorTrait
{
* Advances the inner iterator's pointer
public function next()
return $this->iterator->next();
iterator
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
}
* Returns the inner iterator's current value
* @return mixed
public function current()
return $this->iterator->current();
* Returns the inner iterator's current key
* @return scalar
public function key()
return $this->iterator->key();
* Resets the inner iterator
public function rewind()
return $this->iterator->rewind();
* Returns if the inner iterator is still valid
* @return boolean
public function valid()
return $this->iterator->valid();
* Returns the inner iterator
* @return Iterator
public function getInnerIterator() : Iterator
return $this->iterator;
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: