Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Form] - fixed bug - name in ButtonBuilder #19284

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

Closed
wants to merge 4 commits into from

Conversation

cheprasov
Copy link
Contributor

@cheprasov cheprasov commented Jul 4, 2016

Q A
Branch? "master"
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

Bug:

For any scalar of name, expression empty($name) && 0 != $name is never true,
and as result - empty string ('') is allowed.

Examples:

$name = ''; var_dump(empty($name) && 0 != $name); // false
$name = '0'; var_dump(empty($name) && 0 != $name); // false
$name = null; var_dump(empty($name) && 0 != $name); // false
$name = false; var_dump(empty($name) && 0 != $name); // false
$name = 0; var_dump(empty($name) && 0 != $name); // false

@xabbuh
Copy link
Member

xabbuh commented Jul 5, 2016

Can you add tests to avoid future regressions?

@cheprasov
Copy link
Contributor Author

Hello, @xabbuh
Done.

@Tobion
Copy link
Contributor

Tobion commented Jul 6, 2016

Bug fixes should be opened against branch 2.7 and be PHP 5.3 compatible.

*/
public function testValidNames($name)
{
$this->assertInstanceOf(ButtonBuilder::class, new ButtonBuilder($name));
Copy link
Contributor

Choose a reason for hiding this comment

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

::class is not available in php 5.3

@cheprasov cheprasov closed this Jul 6, 2016
@cheprasov
Copy link
Contributor Author

@Tobion , thanks.
I created a new PR #19306

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants