src/Collection/ArrayCollection.php
public function each(callable $callback): ArrayCollection
    {
        foreach ($this->items as $key => $value) {
            $callback($value, $key);
        }

        return $this;
    }
public function each(callable $callback): ArrayCollection
    {
        foreach ($this->items as $key => $value) {
            $callback($value, $key);
        }

        return $this;
    }
public function each ( callable $ callback ) : ArrayCollection { foreach ( $ this -> items as $ key => $ value ) { $ callback ( $ value , $ key ) ; } return $ this ; }
Applies a callback function to every item

Callback signature:

<code>
function ($value, $key): void {}
</code>

@param callable $callback The callback function

@return ArrayCollection
Applies a callback function to every item