Cart.php
public function remove($uniqueId, $save = true): self
    {
        if (!isset($this->items[$uniqueId])) {
            throw new InvalidParamException('Item not found');
        }

        unset($this->items[$uniqueId]);

        $save && $this->storage->save($this);

        return $this;
    }
public function remove($uniqueId, $save = true): self
    {
        if (!isset($this->items[$uniqueId])) {
            throw new InvalidParamException('Item not found');
        }

        unset($this->items[$uniqueId]);

        $save && $this->storage->save($this);

        return $this;
    }
Removes an item from the cart

@param string $uniqueId
@param bool $save

@throws \yii\base\InvalidParamException

@return $this