Skip to content

[Config] type specific check for emptiness #15170

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

Merged
merged 1 commit into from
Aug 1, 2015
Merged

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Jul 1, 2015

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #13736
License MIT
Doc PR

@wouterj
Copy link
Member

wouterj commented Jul 1, 2015

👍

@xabbuh xabbuh added the Ready label Jul 2, 2015
@xabbuh
Copy link
Member Author

xabbuh commented Jul 7, 2015

ping @symfony/deciders

@fabpot
Copy link
Member

fabpot commented Jul 7, 2015

👍

1 similar comment
@dunglas
Copy link
Member

dunglas commented Jul 7, 2015

👍

@Tobion
Copy link
Contributor

Tobion commented Jul 7, 2015

I'd rather say, as also stated in the ticket, that cannotBeEmpty on a boolean node (etc.) makes no sense. So it should rather throw an exception.

So I'm +-0 with this solution.

@xabbuh
Copy link
Member Author

xabbuh commented Jul 8, 2015

I thought about that too, but decided to go this way as throwing an exception would potentially break many existing applications.

@Tobion
Copy link
Contributor

Tobion commented Jul 8, 2015

Then just change it in 2.8 or 3.0

@xabbuh
Copy link
Member Author

xabbuh commented Jul 8, 2015

Then I suggest to mark the method as deprecated in 2.8 and throw the exception in 3.0. Do you agree with this plan?

@fabpot
Copy link
Member

fabpot commented Jul 14, 2015

@xabbuh I agree

@xabbuh
Copy link
Member Author

xabbuh commented Jul 15, 2015

see #15285 for the deprecations

@xabbuh
Copy link
Member Author

xabbuh commented Jul 15, 2015

I just discovered that the changes did not cover float nodes properly. I moved the check from IntegerNode to NumericNode.

@fabpot
Copy link
Member

fabpot commented Aug 1, 2015

Thank you @xabbuh.

@fabpot fabpot merged commit 0199fbf into symfony:2.3 Aug 1, 2015
fabpot added a commit that referenced this pull request Aug 1, 2015
This PR was merged into the 2.3 branch.

Discussion
----------

[Config] type specific check for emptiness

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #13736
| License       | MIT
| Doc PR        |

Commits
-------

0199fbf [Config] type specific check for emptiness

public function getValidNonEmptyValues()
{
return array(
Copy link

Choose a reason for hiding this comment

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

What about "0" ?

Copy link
Member Author

Choose a reason for hiding this comment

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

What do you mean?

Copy link

Choose a reason for hiding this comment

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

Well shouldn't that value be there as well ?

Maybe I'm wrong, I just wanted to make sure you didn't accidentally miss it :)

Copy link
Member Author

Choose a reason for hiding this comment

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

It's true that we could have added it, but I think it's not absolutely necessary. Of course, if you think it deserves its own test, please don't hesitate to make a pull request for it. :)

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.

6 participants