<commit_before><?php

/*
 * This file is part of the Sylius package.
 *
 * (c) <NAME>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Sylius\Component\Inventory\Operator;

use Sylius\Component\Inventory\Model\StockableInterface;

/**
 * Thrown when decreasing stockable quantity while it is insufficient.
 *
 * @author <NAME> <<EMAIL>>
 */
class InsufficientStockException extends \UnderflowException
{
    /**
     * @var StockableInterface
     */
    protected $stockable;

    /**
     * @param StockableInterface    $stockable
     * @param integer               $quantity
     */
    public function __construct(StockableInterface $stockable, $quantity)
    {
        $this->stockable = $stockable;

        parent::__construct(sprintf(
            'Only %d %s(s) on hand, %d requested.',
            $stockable->getOnHand(),
            $stockable->getInventoryName(),
            $quantity
        ));
    }

    /**
     * @return StockableInterface<commit_msg>Cleanup bundle & component dependencies<commit_after><?php

/*
 * This file is part of the Sylius package.
 *
 * (c) <NAME>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Sylius\Component\Inventory\Operator;

use Sylius\Component\Inventory\Model\StockableInterface;

/**
 * Thrown when decreasing stockable quantity while it is insufficient.
 *
 * @author <NAME> <<EMAIL>>
 */
class InsufficientStockException extends \UnderflowException
{
    /**
     * @var StockableInterface
     */
    protected $stockable;

    /**
     * @param StockableInterface $stockable
     * @param integer            $quantity
     */
    public function __construct(StockableInterface $stockable, $quantity)
    {
        $this->stockable = $stockable;

        parent::__construct(sprintf(
            'Only %d %s(s) on hand, %d requested.',
            $stockable->getOnHand(),
            $stockable->getInventoryName(),
            $quantity
        ));
    }

    /**
     * @return StockableInterface
{'fraction_non_alphanumeric': 0.10909935004642525, 'fraction_numerical': 0.0, 'mean_word_length': 2.6587436332767402, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7472512', 'n_tokens_mistral': 607, 'n_tokens_neox': 588, 'n_words': 162}