We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd43c59 commit e221d93Copy full SHA for e221d93
src/Node/NodeList.php
@@ -18,6 +18,22 @@ public function __construct(
18
public array $items = [],
19
) {}
20
21
+ /**
22
+ * @return TNode|null
23
+ */
24
+ public function first(): ?Node
25
+ {
26
+ return \reset($this->items) ?: null;
27
+ }
28
+
29
30
31
32
+ public function last(): ?Node
33
34
+ return \end($this->items) ?: null;
35
36
37
public function getIterator(): \Traversable
38
{
39
return new \ArrayIterator($this->items);
0 commit comments