4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Console\Exception;
15 * Represents an incorrect command name typed in the console.
17 * @author Jérôme Tamarelle <jerome@tamarelle.net>
19 class CommandNotFoundException extends \InvalidArgumentException implements ExceptionInterface
21 private $alternatives;
24 * @param string $message Exception message to throw
25 * @param array $alternatives List of similar defined names
26 * @param int $code Exception code
27 * @param Exception $previous previous exception used for the exception chaining
29 public function __construct($message, array $alternatives = array(), $code = 0, \Exception $previous = null)
31 parent::__construct($message, $code, $previous);
33 $this->alternatives = $alternatives;
37 * @return array A list of similar defined names
39 public function getAlternatives()
41 return $this->alternatives;