Lines Matching refs:nodes
31 * @param iterable $nodes
33 public function __construct(Document $document = null, iterable $nodes = null) { argument
34 parent::__construct($nodes);
84 array_reverse($this->nodes);
93 return !empty($this->nodes) ? $this->rewind() : null;
107 return !empty($this->nodes) ? end($this->nodes) : null;
116 if (isset($this->nodes[$key])) {
117 return $this->nodes[$key];
130 $this->nodes[$key] = $value;
141 foreach ($this->nodes as $index => $node) {
158 $nodes = $this->newNodeList();
160 foreach ($this->nodes as $node) {
164 $nodes[] = $result;
168 return $nodes;
178 return array_reduce($this->nodes, $function, $initial);
185 return $this->nodes;
189 * @param iterable $nodes
191 public function fromArray(iterable $nodes = null) { argument
192 $this->nodes = [];
194 if (is_iterable($nodes)) {
195 foreach ($nodes as $node) {
196 $this->nodes[] = $node;
232 $this->nodes[] = $node;
241 return array_pop($this->nodes);
250 array_unshift($this->nodes, $node);
259 return array_shift($this->nodes);
268 return in_array($node, $this->nodes, true);
277 $index = array_search($node, $this->nodes, true);
280 unset($this->nodes[$index]);