Skip to content

[Form] deprecate some options for single_text widgets #28721

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

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Oct 4, 2018

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

@xabbuh xabbuh added this to the next milestone Oct 4, 2018
@xabbuh xabbuh force-pushed the datetime-type-singletext-deprecations branch from 3681b21 to 29f1daf Compare October 4, 2018 10:35
@xabbuh xabbuh force-pushed the datetime-type-singletext-deprecations branch from 29f1daf to 65a765e Compare October 4, 2018 11:13
Copy link
Contributor

@HeahDude HeahDude left a comment

Choose a reason for hiding this comment

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

Nice move, I like that 👍

@xabbuh xabbuh force-pushed the datetime-type-singletext-deprecations branch 12 times, most recently from c1bc7a2 to d10e7a7 Compare October 9, 2018 12:34
fabpot added a commit that referenced this pull request Oct 10, 2018
…ion closure (yceruto)

This PR was squashed before being merged into the 4.2-dev branch (closes #28738).

Discussion
----------

[OptionsResolver] Passing Options argument to deprecation closure

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #28721 (comment)
| License       | MIT
| Doc PR        | symfony/symfony-docs#10439

As spotted here #28721, we sometimes need more advanced cases, where the deprecation of the value depends on another option:
```php
$resolver->setDeprecated('date_format', function (Options $options, $dateFormat) {
    if (null !== $options['date_format'] && 'single_text' === $options['widget']) {
         return sprintf('Using the "date_format" option of the %s when the "widget" option is set to "single_text" is deprecated since Symfony 4.2.', self::class);
    }

    return '';
});
```
There is still a decision to make:
> We're in time to change the arguments position (Options $options, $value) to be consistent with other closure signatures.

WDYT?

Commits
-------

2936051 [OptionsResolver] Passing Options argument to deprecation closure
@xabbuh
Copy link
Member Author

xabbuh commented Oct 10, 2018

Status: Needs work

@xabbuh xabbuh force-pushed the datetime-type-singletext-deprecations branch from d10e7a7 to 11f32ca Compare October 10, 2018 11:13
@xabbuh xabbuh force-pushed the datetime-type-singletext-deprecations branch from 11f32ca to 3f951a5 Compare October 10, 2018 11:14
@xabbuh
Copy link
Member Author

xabbuh commented Oct 10, 2018

Status: Needs Review

@xabbuh xabbuh force-pushed the datetime-type-singletext-deprecations branch from 3f951a5 to 882a4cc Compare October 10, 2018 12:41
@xabbuh xabbuh force-pushed the datetime-type-singletext-deprecations branch from 882a4cc to 81b3d9a Compare October 22, 2018 06:30
@xabbuh xabbuh force-pushed the datetime-type-singletext-deprecations branch from 81b3d9a to e9cbc61 Compare November 16, 2018 08:02
@xabbuh xabbuh force-pushed the datetime-type-singletext-deprecations branch 2 times, most recently from 241290a to 0ab3e8d Compare January 5, 2019 17:01
@xabbuh
Copy link
Member Author

xabbuh commented Jan 5, 2019

Status: Needs Review

@xabbuh xabbuh force-pushed the datetime-type-singletext-deprecations branch from 0ab3e8d to 89ff331 Compare January 16, 2019 23:04
@nicolas-grekas
Copy link
Member

Thank you @xabbuh.

@nicolas-grekas nicolas-grekas merged commit 89ff331 into symfony:master Jan 27, 2019
nicolas-grekas added a commit that referenced this pull request Jan 27, 2019
…(xabbuh)

This PR was merged into the 4.3-dev branch.

Discussion
----------

[Form] deprecate some options for single_text widgets

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

Commits
-------

89ff331 deprecate some options for single_text widgets
@xabbuh xabbuh deleted the datetime-type-singletext-deprecations branch January 27, 2019 19:54
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Mar 7, 2019
…iereguiluz)

This PR was merged into the master branch.

Discussion
----------

Added a note about the deprecations of DateTimeType

Documents symfony/symfony#28721.

Commits
-------

89f0296 Added a note about the deprecations of DateTimeType
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.3 Apr 30, 2019
@fabpot fabpot mentioned this pull request May 9, 2019
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.

7 participants