-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form] Php doc fixes and cs + optimizations #30879
New issu 10000 e
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
src/Symfony/Component/Form/Form.php
Outdated
} | ||
|
||
if (null === $this->getName() || '' === $this->getName()) { | ||
if (!$this->name) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if the name is '0'
? 😄 Can it happen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it can, nice catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we add a testcase or is there already one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok so I would just write if (trim($this->name) === '')
As discussed let's avoid the function call 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No function call :)
Thanks for the reviews :). Comments addressed, ready for another round! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, fix chained -> chain
Thank you @HeahDude. |
This PR was merged into the 3.4 branch. Discussion - 57AE --------- [Form] Php doc fixes and cs + optimizations | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | ~ | License | MIT | Doc PR | ~ <!-- Write a short README entry for your feature/bugfix here (replace this comment block.) This will help people understand your PR and can be used as a start of the Doc PR. Additionally: - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. --> Some micro optimizations may target master with some profiling but I would like some reviews first. Thanks! Commits ------- 56429a6 [Form] various minor fixes
This PR was merged into the 3.4 branch. Discussion ---------- [Form] fix tests | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #30879 | License | MIT | Doc PR | Commits ------- 83c661d fix tests
Some micro optimizations may target master with some profiling but I would like some reviews first. Thanks!