Extract default help header to protected method.

This commit is contained in:
diezztsk
2016-11-03 11:41:34 +07:00
parent 26ad3ced49
commit 99f1d04421

View File

@ -182,7 +182,7 @@ class HelpController extends Controller
protected function getDefaultHelp()
{
$commands = $this->getCommandDescriptions();
$this->stdout("\nThis is Yii version " . \Yii::getVersion() . ".\n");
$this->stdout($this->getDefaultHelpHeader());
if (!empty($commands)) {
$this->stdout("\nThe following commands are available:\n\n", Console::BOLD);
$len = 0;
@ -437,4 +437,13 @@ class HelpController extends Controller
{
return basename(Yii::$app->request->scriptFile);
}
/**
* Display a default help header.
* @return string default help header.
*/
protected function getDefaultHelpHeader()
{
return "\nThis is Yii version " . \Yii::getVersion() . ".\n";
}
}