Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GenerateAction.php #531

Merged
merged 3 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/console/GenerateAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading