mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 21:41:19 +08:00
Fixes #17124: Fixed ErrorException when run ./yii fixture/unload without arguments
This commit is contained in:
committed by
Alexander Makarov
parent
fc98a95a90
commit
e6513a2c9e
@ -109,11 +109,7 @@ class FixtureController extends Controller
|
||||
public function actionLoad(array $fixturesInput = [])
|
||||
{
|
||||
if ($fixturesInput === []) {
|
||||
$this->stdout($this->getHelpSummary() . "\n");
|
||||
|
||||
$helpCommand = Console::ansiFormat('yii help fixture', [Console::FG_CYAN]);
|
||||
$this->stdout("Use $helpCommand to get usage info.\n");
|
||||
|
||||
$this->printHelpMessage();
|
||||
return ExitCode::OK;
|
||||
}
|
||||
|
||||
@ -188,6 +184,11 @@ class FixtureController extends Controller
|
||||
*/
|
||||
public function actionUnload(array $fixturesInput = [])
|
||||
{
|
||||
if ($fixturesInput === []) {
|
||||
$this->printHelpMessage();
|
||||
return ExitCode::OK;
|
||||
}
|
||||
|
||||
$filtered = $this->filterFixtures($fixturesInput);
|
||||
$except = $filtered['except'];
|
||||
|
||||
@ -232,6 +233,18 @@ class FixtureController extends Controller
|
||||
$this->notifyUnloaded($fixtures);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show help message.
|
||||
* @param array $fixturesInput
|
||||
*/
|
||||
private function printHelpMessage()
|
||||
{
|
||||
$this->stdout($this->getHelpSummary() . "\n");
|
||||
|
||||
$helpCommand = Console::ansiFormat('yii help fixture', [Console::FG_CYAN]);
|
||||
$this->stdout("Use $helpCommand to get usage info.\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* Notifies user that fixtures were successfully loaded.
|
||||
* @param array $fixtures
|
||||
|
||||
Reference in New Issue
Block a user