src/Cart.php
public function find($itemId)
    {
        foreach ($this->items as $item) {
            if ($itemId === $item->id) {
                return $item;
            }
        }

        return;
    }
public function find($itemId)
    {
        foreach ($this->items as $item) {
            if ($itemId === $item->id) {
                return $item;
            }
        }

        return;
    }
public function find ( $ itemId ) { foreach ( $ this -> items as $ item ) { if ( $ itemId === $ item -> id ) { return $ item ; } } return ; }
Find an item in the cart.

@param string $itemId

@return CartItem|null
Find an item in the cart .