File manager - Edit - /home/verseaumee/ptitsanes/libraries/gantry5/src/classes/Gantry/Component/Collection/Collection.php
Back
<?php /** * @package Gantry5 * @author RocketTheme http://www.rockettheme.com * @copyright Copyright (C) 2007 - 2022 RocketTheme, LLC * @license Dual License: MIT or GNU/GPLv2 and later * * http://opensource.org/licenses/MIT * http://www.gnu.org/licenses/gpl-2.0.html * * Gantry Framework code that extends GPL code is considered GNU/GPLv2 and later */ namespace Gantry\Component\Collection; use RocketTheme\Toolbox\ArrayTraits\ArrayAccess; use RocketTheme\Toolbox\ArrayTraits\Countable; use RocketTheme\Toolbox\ArrayTraits\Export; /** * Class Collection * @package Gantry\Component\Collection */ class Collection implements CollectionInterface { use ArrayAccess, Countable, Export; /** @var array */ protected $items = []; /** * @param array $variables * @return Collection */ public static function __set_state($variables) { $instance = new static(); $instance->items = $variables['items']; return $instance; } /** * * Create a copy of this collection. * * @return static */ public function copy() { return clone $this; } /** * @param mixed $item * @return $this */ public function add($item) { $this->items[] = $item; return $this; } /** * @return \ArrayIterator */ #[\ReturnTypeWillChange] public function getIterator() { return new \ArrayIterator($this->items); } }
| ver. 1.4 |
Github
|
.
| PHP 8.5.7 | Generation time: 0 |
proxy
|
phpinfo
|
Settings