Skip to content

[Form] Fix inconsistencies #32935

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 5, 2019

Conversation

vudaltsov
Copy link
Contributor

@vudaltsov vudaltsov commented Aug 4, 2019

Q A
Branch? 3.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR n/a
  • Use @inheritdoc in Button and ButtonBuilder where the method does satisfy the contract.
  • Add This method should not be invoked in all unsupported methods in Button and ButtonBuilder for consistency.
  • Fix the misused idempotent term in implementations of the getFormConfig method. It is wrong in the sense that the method does not always return the same result. You can setAttribute for instance and getFormConfig will return a different config object.
  • Add if ($this->locked) checks in the supported mutators.
  • Fix the arguments contract in the ChoiceListFactoryInterface — now it supports PropertyPathInterface explicitly. The downside of it — breaking LSP in the DefaultChoiceListFactory.
  • Fix the $label phpdoc of the ChoiceView (arised in [Form] Add parameter type declarations #32237).
  • Use PropertyPathInterface instead of PropertyPath in PropertyAccessDecorator of the choice factory.
  • Fix ArrayChoiceList::flatten type hints.

These changes are debatable, so feel free to correct me if I am wrong at some point.

Ping @xabbuh , @HeahDude , @yceruto , @nicolas-grekas

@vudaltsov vudaltsov force-pushed the form-inconsistencies-fixes branch from 0f6f833 to 2e95887 Compare August 4, 2019 22:10
@nicolas-grekas nicolas-grekas added this to the 3.4 milestone Aug 5, 2019
@vudaltsov vudaltsov force-pushed the form-inconsistencies-fixes branch from 8d3ffef to df57d08 Compare August 5, 2019 10:16
@vudaltsov
Copy link
Contributor Author

@Tobion , I reverted all controversial changes.

@vudaltsov
Copy link
Contributor Author

@nicolas-grekas , done.
Also removed to useless phpdoc types in ChoiceListFactoryInterface

@nicolas-grekas nicolas-grekas force-pushed the form-inconsistencies-fixes branch from b9af18f to 360711c Compare August 5, 2019 14:17
@nicolas-grekas
Copy link
Member

Thank you @vudaltsov.

@nicolas-grekas nicolas-grekas merged commit 360711c into symfony:3.4 Aug 5, 2019
nicolas-grekas added a commit that referenced this pull request Aug 5, 2019
This PR was squashed before being merged into the 3.4 branch (closes #32935).

Discussion
----------

[Form] Fix inconsistencies

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

- ~~Use `@inheritdoc` in `Button` and `ButtonBuilder` where the method does satisfy the contract.~~
- ~~Add `This method should not be invoked` in all unsupported methods in `Button` and `ButtonBuilder` for consistency.~~
- ~~Fix the misused `idempotent` term in implementations of the `getFormConfig` method. It is wrong in the sense that the method does not always return the same result. You can `setAttribute` for instance and `getFormConfig` will return a different config object.~~
- ~~Add `if ($this->locked)` checks in the supported mutators.~~
- ~~Fix the arguments contract in the `ChoiceListFactoryInterface` — now it supports `PropertyPathInterface` explicitly. The downside of it — breaking LSP in the `DefaultChoiceListFactory`.~~
- Fix the `$label` phpdoc of the `ChoiceView` (arised in #32237).
- Use `PropertyPathInterface` instead of `PropertyPath` in `PropertyAccessDecorator` of the choice factory.
- Fix `ArrayChoiceList::flatten` type hints.

These changes are debatable, so feel free to correct me if I am wrong at some point.

Ping @xabbuh , @HeahDude , @yceruto , @nicolas-grekas

Commits
-------

360711c [Form] Fix inconsistencies
@vudaltsov vudaltsov deleted the form-inconsistencies-fixes branch August 5, 2019 14:18
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