private function validateCartLine(CartLineInterface $cartLine)
    {
        $cart = $cartLine->getCart();
        $purchasable = $cartLine->getPurchasable();
        $realStockAvailable = $this
            ->purchasableStockValidator
            ->isStockAvailable(
                $purchasable,
                $cartLine->getQuantity(),
                $this->useStock
            );

        if (
            false === $realStockAvailable ||
            $realStockAvailable === 0
        ) {
            $this->cartManager->silentRemoveLine(
                $cart,
                $cartLine
            );

            /**
             * An inconsistent cart event is dispatched.
             */
            $this
                ->cartEventDispatcher
                ->dispatchCartInconsistentEvent(
                    $cart,
                    $cartLine
                );

            return $cartLine;
        }

        if (is_int($realStockAvailable)) {
            $cartLine->setQuantity($realStockAvailable);
        }

        return $cartLine;
    }