Source of file Iterator.php
Size: 1,319 Bytes - Last Modified: 2021-12-23T10:20:55+00:00
/var/www/docs.ssmods.com/process/src/thirdparty/css-crush/lib/CssCrush/Iterator.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 | <?php /** * * Base iterator for Declaration and Selector lists. * */ namespace CssCrush; class Iterator implements \IteratorAggregate, \ArrayAccess, \Countable { public $store; public function __construct($items = array()) { $this->store = $items; } /* IteratorAggregate implementation. */ public function getIterator() { return new \ArrayIterator($this->store); } /* ArrayAccess implementation. */ public function offsetExists($index) { return array_key_exists($index, $this->store); } public function offsetGet($index) { return isset($this->store[$index]) ? $this->store[$index] : null; } public function offsetSet($index, $value) { $this->store[$index] = $value; } public function offsetUnset($index) { unset($this->store[$index]); } public function getContents() { return $this->store; } /* Countable implementation. */ public function count() { return count($this->store); } /* Collection interface. */ public function filter($filterer, $op = '===') { $collection = new Collection($this->store); return $collection->filter($filterer, $op); } } |