We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ae54014 commit 0519ff1Copy full SHA for 0519ff1
1 file changed
src/Utils/BaseSet.php
@@ -51,6 +51,24 @@ public function count() : int
51
{
52
return \count($this->array);
53
}
54
+
55
+ public function getFirst() : ?object
56
+ {
57
+ $key = \array_key_first($this->array);
58
59
+ return $key === null
60
+ ? null
61
+ : $this->array[$key];
62
+ }
63
64
+ public function getLast() : ?object
65
66
+ $key = \array_key_last($this->array);
67
68
69
70
71
72
73
public function offsetExists($offset) : bool
74
0 commit comments