yii\console\UnknownCommandException - Yii2 类参考手册
Class yii\console\UnknownCommandException
Inheritance | yii\console\UnknownCommandException » yii\console\Exception » yii\base\UserException » yii\base\Exception » Exception |
---|---|
Available since version | 2.0.11 |
UnknownCommandException represents an exception caused by incorrect usage of a console command.
Public Properties
隐藏继承的属性 Hide inherited properties
属性Property | 类型 Type | 简介 Description | 定义在 Defined By |
---|---|---|---|
$command | string | The name of the command that could not be recognized. | yii\console\UnknownCommandException |
Protected Properties
隐藏继承的属性 Hide inherited properties
属性Property | 类型 Type | 简介 Description | 定义在 Defined By |
---|---|---|---|
$application | yii\console\Application | yii\console\UnknownCommandException |
Public Methods
隐藏继承的方法 Hide inherited methods
方法 Method | 简介 Description | 定义在 Defined By |
---|---|---|
__construct() | Construct the exception. | yii\console\UnknownCommandException |
getName() | yii\console\UnknownCommandException | |
getSuggestedAlternatives() | Suggest alternative commands for $command based on string similarity. | yii\console\UnknownCommandException |
属性详情 Property Details
The name of the command that could not be recognized.
方法详情 Method Details
Construct the exception.
public void __construct ( $route, $application, $code = 0, Exception $previous = null ) | ||
$route | string | The route of the command that could not be found. |
$application | yii\console\Application | The console application instance involved. |
$code | integer | The Exception code. |
$previous | Exception | The previous exception used for the exception chaining. |
public string getName ( ) | ||
return | string | The user-friendly name of this exception |
---|
Suggest alternative commands for $command based on string similarity.
Alternatives are searched using the following steps:
- suggest alternatives that begin with
$command
- find typos by calculating the Levenshtein distance between the unknown command and all available commands. The Levenshtein distance is defined as the minimal number of characters you have to replace, insert or delete to transform str1 into str2.
请参阅 https://secure.php.net/manual/en/function.levenshtein.php.
public array getSuggestedAlternatives ( ) | ||
return | array | A list of suggested alternatives sorted by similarity. |
---|