Cli/src/Exceptions/Command/NotEnoughParametersException.php

24 lines
899 B
PHP

<?php
namespace Nest\Cli\Exceptions\Command;
use Nest\Cli\Commands\CommandContext;
use Throwable;
/**
* Exception thrown when not enough parameters have been provided.
*/
class NotEnoughParametersException extends InvalidParametersException
{
/**
* @param int $providedCount Provided parameters count.
* @param int $expectedCount Expected parameters count.
* @param CommandContext $commandContext Command context.
* @param int $code [optional] The Exception code.
* @param null|Throwable $previous [optional] The previous throwable used for the exception chaining.
*/
public function __construct(public int $providedCount, public int $expectedCount, CommandContext $commandContext, int $code = 0, ?Throwable $previous = null)
{
parent::__construct($commandContext, "Not enough parameters: $this->providedCount provided, expected $this->expectedCount.", $code, $previous);
}
}