diff --git a/component/Abstract/Collection.php b/component/Abstract/Collection.php index 2583c1c..8b4cca7 100644 --- a/component/Abstract/Collection.php +++ b/component/Abstract/Collection.php @@ -12,7 +12,7 @@ public function __construct(array $items = []) $this->items = $items; } - protected function addItem(mixed $item) + protected function addItem(mixed $item): self { if (array_search($item, $this->items) == false) { $this->items[] = $item; @@ -21,7 +21,7 @@ protected function addItem(mixed $item) return $this; } - protected function removeItem(mixed $item) + protected function removeItem(mixed $item): self { if (($key = array_search($item, $this->items)) !== false) { unset($this->items[ $key ]); @@ -30,7 +30,7 @@ protected function removeItem(mixed $item) return $this; } - public function itemsIterator() + public function itemsIterator(): \Generator { foreach ($this->items as $item) { yield $item;