Skip to content

Conversation

@nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Jun 8, 2019

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

This has been added by @yceruto in #28878 but it doesn't make sense to me: the interface has no concept if deprecation (OptionsResolver has!)

@ro0NL
Copy link
Contributor

ro0NL commented Jun 8, 2019

the idea was for e.g. vendors using OptionsResolver to opt-out from end-user deprecations themselves, i.e. the same reason why SF needs it.

So it's a feature .. kinda :)

@nicolas-grekas
Copy link
Member Author

Does this have to be at the Options level? Because sure, it also exists on OptionsResolver and it makes sense there.

@ro0NL
Copy link
Contributor

ro0NL commented Jun 8, 2019

Does this have to be at the Options level?

I think yes, because that's what you typehint for:

$resolver->setDefaults([
    'a' => function (Options $options) {
        $b = $options->offsetGet('b', false); // never triggers
        $c = $options['c']; // always triggers
    },
]);

Copy link
Member

@yceruto yceruto left a comment

Choose a reason for hiding this comment

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

Yes, the new argument is an implementation detail of the OptionsResolver. I agree it shouldn't be part of the interface.

@yceruto
Copy link
Member

yceruto commented Jun 8, 2019

This was about documentation only :) (for IDEs mainly)

@yceruto
Copy link
Member

yceruto commented Jun 8, 2019

should be target 4.2

@nicolas-grekas nicolas-grekas modified the milestones: 4.3, 4.2 Jun 9, 2019
@nicolas-grekas nicolas-grekas changed the base branch from 4.3 to 4.2 June 9, 2019 16:15
@nicolas-grekas nicolas-grekas merged commit adc7e6a into symfony:4.2 Jun 9, 2019
nicolas-grekas added a commit that referenced this pull request Jun 9, 2019
…ons::offsetGet() (nicolas-grekas)

This PR was submitted for the 4.3 branch but it was merged into the 4.2 branch instead (closes #31950).

Discussion
----------

[OptionsResolver] fix adding $triggerDeprecation to Options::offsetGet()

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

This has been added by @yceruto in #28878 but it doesn't make sense to me: the interface has no concept if deprecation (`OptionsResolver` has!)

Commits
-------

adc7e6a [OptionsResolver] fix adding $triggerDeprecation to Options::offsetGet()
@nicolas-grekas nicolas-grekas deleted the opt-no-deprec branch June 18, 2019 07:23
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