src/Collection/Chain/SetBucketChain.php
protected function locate($item): ?ItemBucket
    {
        for ($this->rewind(); $this->valid(); $this->next()) {
            /** @var ItemBucket $current */
            $current = $this->current;
            if (Validate::areEqual($item, $current->item())) {
                return $current;
            }
        }

        return null;
    }
protected function locate($item): ?ItemBucket
    {
        for ($this->rewind(); $this->valid(); $this->next()) {
            /** @var ItemBucket $current */
            $current = $this->current;
            if (Validate::areEqual($item, $current->item())) {
                return $current;
            }
        }

        return null;
    }
protected function locate ( $ item ) : ? ItemBucket { for ( $ this -> rewind ( ) ; $ this -> valid ( ) ; $ this -> next ( ) ) { /** @var ItemBucket $current */ $ current = $ this -> current ; if ( Validate :: areEqual ( $ item , $ current -> item ( ) ) ) { return $ current ; } } return null ; }
Locates a bucket by item

Returns null if the item is not found.

@param mixed $item The item

@return ItemBucket|null
Locates a bucket by item