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 view generators/crud/default/controller #469

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

WinterSilence
Copy link
Contributor

@WinterSilence WinterSilence commented Sep 25, 2021

Fix return type in PhpDoc
Add Php 7 features (optional)

Q A
Is bugfix? no
New feature? no
Breaks BC? no
Tests pass? yes
Fixed issues

Fix return type in PhpDoc
Add Php 7 features (optional)
Use `Yii::createObject()` instead `new className()`
src/generators/crud/default/controller.php Outdated Show resolved Hide resolved
src/generators/crud/default/controller.php Outdated Show resolved Hide resolved
src/generators/crud/default/controller.php Outdated Show resolved Hide resolved
src/generators/crud/default/controller.php Outdated Show resolved Hide resolved
src/generators/crud/default/controller.php Outdated Show resolved Hide resolved
src/generators/crud/default/controller.php Show resolved Hide resolved
src/generators/crud/default/controller.php Show resolved Hide resolved
src/generators/crud/default/controller.php Outdated Show resolved Hide resolved
src/generators/crud/default/controller.php Outdated Show resolved Hide resolved
@@ -184,10 +190,11 @@ protected function findModel(<?= $actionParams ?>)
}
$condition = '[' . implode(', ', $condition) . ']';
?>
if (($model = <?= $modelClass ?>::findOne(<?= $condition ?>)) !== null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was OK as is. No need for change here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samdark it's less readable

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's not. That's more of personal preferences. I'd not change it for that reason.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than that, you've changed early return to late return complicating the code a bit. With this assign in condition I agree.

@samdark samdark added the status:under development Someone is working on a pull request. label Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:under development Someone is working on a pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants