diff --git a/CHANGELOG.md b/CHANGELOG.md index 672c7a2a5..6a8b8e0da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Yii Framework 2 gii extension Change Log 2.2.7 under development ----------------------- +- Bug #531: Fix `yii\gii\console\GenerateAction` to use `stdout()` instead of echoing the output (egmsystems) - Bug #532: Return `ExitCode::USAGE` on command input validation error (egmsystems) - Enh #537: Generating rules for the fields with default values (manky) - Enh #542: Use the table name to create the relation (thiagotalma) diff --git a/src/console/GenerateAction.php b/src/console/GenerateAction.php index 69cc8148e..40920f536 100644 --- a/src/console/GenerateAction.php +++ b/src/console/GenerateAction.php @@ -44,9 +44,9 @@ protected function displayValidationErrors() { $this->controller->stdout("Code not generated. Please fix the following errors:\n\n", Console::FG_RED); foreach ($this->generator->errors as $attribute => $errors) { - echo ' - ' . $this->controller->ansiFormat($attribute, Console::FG_CYAN) . ': ' . implode('; ', $errors) . "\n"; + $this->controller->stdout(' - ' . $this->controller->ansiFormat($attribute, Console::FG_CYAN) . ': ' . implode('; ', $errors) . "\n"); } - echo "\n"; + $this->controller->stdout("\n"); } protected function generateCode()