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

Skip to content

[OptionsResolver] Implemented policies for treating unknown/missing options #10616

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 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
[OptionsResolver] Documented BC break in resolve()
  • Loading branch information
webmozart committed Apr 2, 2014
commit bf281522ad2d6d2667ed2868670f6d9e8ddb8f4c
34 changes: 33 additions & 1 deletion UPGRADE-2.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,38 @@ Form
{
```

OptionsResolver
---------------

* A new parameter `$flags` was added to `OptionsResolverInterface::resolve()`.
The parameter takes a bitwise combination of the new flag constants in that
interface.

If you implement the interface in your code, you should add the parameter as
well.

Before:

```
public function resolve(array $options = array())
{
// ...
}
```

After:

```
public function resolve(array $options = array(), $flags = 0)
{
if ($flags & self::FORBID_UNKNOWN) {
// ...
}

// ...
}
```

Validator
---------

Expand All @@ -56,7 +88,7 @@ Validator

After:

Default email validation is now done via a simple regex which may cause invalid emails (not RFC compilant) to be
Default email validation is now done via a simple regex which may cause invalid emails (not RFC compilant) to be
valid. This is the default behaviour.

Strict email validation has to be explicitly activated in the configuration file by adding
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/OptionsResolver/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ CHANGELOG
2.5.0
-----

* [BC BREAK] added parameter $flags to OptionsResolverInterface::resolve()
* added flags FORBID_UNKNOWN, REMOVE_UNKNOWN, IGNORE_UNKNOWN, FORBID_MISSING
and IGNORE_MISSING to OptionsResolverInterface