Chris@0
|
1 <?php
|
Chris@0
|
2
|
Chris@0
|
3 /*
|
Chris@0
|
4 * This file is part of the Symfony package.
|
Chris@0
|
5 *
|
Chris@0
|
6 * (c) Fabien Potencier <fabien@symfony.com>
|
Chris@0
|
7 *
|
Chris@0
|
8 * For the full copyright and license information, please view the LICENSE
|
Chris@0
|
9 * file that was distributed with this source code.
|
Chris@0
|
10 */
|
Chris@0
|
11
|
Chris@0
|
12 namespace Symfony\Component\Console\Exception;
|
Chris@0
|
13
|
Chris@0
|
14 /**
|
Chris@0
|
15 * Represents an incorrect command name typed in the console.
|
Chris@0
|
16 *
|
Chris@0
|
17 * @author Jérôme Tamarelle <jerome@tamarelle.net>
|
Chris@0
|
18 */
|
Chris@0
|
19 class CommandNotFoundException extends \InvalidArgumentException implements ExceptionInterface
|
Chris@0
|
20 {
|
Chris@0
|
21 private $alternatives;
|
Chris@0
|
22
|
Chris@0
|
23 /**
|
Chris@14
|
24 * @param string $message Exception message to throw
|
Chris@14
|
25 * @param array $alternatives List of similar defined names
|
Chris@14
|
26 * @param int $code Exception code
|
Chris@14
|
27 * @param \Exception $previous Previous exception used for the exception chaining
|
Chris@0
|
28 */
|
Chris@0
|
29 public function __construct($message, array $alternatives = array(), $code = 0, \Exception $previous = null)
|
Chris@0
|
30 {
|
Chris@0
|
31 parent::__construct($message, $code, $previous);
|
Chris@0
|
32
|
Chris@0
|
33 $this->alternatives = $alternatives;
|
Chris@0
|
34 }
|
Chris@0
|
35
|
Chris@0
|
36 /**
|
Chris@0
|
37 * @return array A list of similar defined names
|
Chris@0
|
38 */
|
Chris@0
|
39 public function getAlternatives()
|
Chris@0
|
40 {
|
Chris@0
|
41 return $this->alternatives;
|
Chris@0
|
42 }
|
Chris@0
|
43 }
|