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

[OptionsResolver] Fix options resolver with array allowed types #25763

Merged

Conversation

mcg-web
Copy link
Contributor

@mcg-web mcg-web commented Jan 11, 2018

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

When playing a simple test:

use Symfony\Component\OptionsResolver\Options;

$resolver = new OptionsResolver();
$resolver->setDefined('foo');
$resolver->setAllowedTypes('foo', 'string[]');
$options = $resolver->resolve(['foo' => ['bar', 'baz']]);

I get this error:

Symfony\Component\OptionsResolver\Exception\InvalidOptionsException: The option "foo" with value array is expected to be of type "string[]", but is of type "string[]"

This PR should fix this.

@mcg-web mcg-web force-pushed the fix-options-resolver-with-array-allowed-types branch from 1e46b19 to cc215f7 Compare January 11, 2018 07:56
@mcg-web mcg-web changed the title Fix options resolver with array allowed types [OptionsResolver]Fix options resolver with array allowed types Jan 11, 2018
@mcg-web mcg-web changed the title [OptionsResolver]Fix options resolver with array allowed types [OptionsResolver] Fix options resolver with array allowed types Jan 11, 2018
@nicolas-grekas nicolas-grekas added this to the 3.4 milestone Jan 16, 2018
@soullivaneuh
Copy link
Contributor

soullivaneuh commented Jan 17, 2018

@mcg-web Is any workaround possible waiting this PR getting merged and released?

@mcg-web
Copy link
Contributor Author

mcg-web commented Jan 17, 2018

@soullivaneuh this PR is just a fix so this is totally ready for merge

@fabpot
Copy link
Member

fabpot commented Jan 17, 2018

Thank you @mcg-web.

@fabpot fabpot merged commit cc215f7 into symfony:3.4 Jan 17, 2018
fabpot added a commit that referenced this pull request Jan 17, 2018
…types (mcg-web)

This PR was merged into the 3.4 branch.

Discussion
----------

[OptionsResolver] Fix options resolver with array allowed types

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

When playing a simple test:

```php
use Symfony\Component\OptionsResolver\Options;

$resolver = new OptionsResolver();
$resolver->setDefined('foo');
$resolver->setAllowedTypes('foo', 'string[]');
$options = $resolver->resolve(['foo' => ['bar', 'baz']]);
```

I get this error:

```
Symfony\Component\OptionsResolver\Exception\InvalidOptionsException: The option "foo" with value array is expected to be of type "string[]", but is of type "string[]"
```

This PR should fix this.

Commits
-------

cc215f7 Fix options resolver with array allowed types
@mcg-web mcg-web deleted the fix-options-resolver-with-array-allowed-types branch January 18, 2018 06:20
This was referenced Jan 29, 2018
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.

5 participants