Skip to content

[Validator] removed deprecated features in Validator and Form #16024

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 7 commits into from
Oct 1, 2015

Conversation

fabpot
Copy link
Member

@fabpot fabpot commented Sep 30, 2015

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

@fabpot fabpot force-pushed the validator-deprecations branch 5 times, most recently from 1107d80 to f523d9d Compare September 30, 2015 14:59
@fabpot fabpot force-pushed the validator-deprecations branch 6 times, most recently from 8032708 to 5f334ca Compare September 30, 2015 17:23
@fabpot fabpot changed the title [WIP] [Validator] removed deprecated features in Constraints [Validator] removed deprecated features in Constraints Sep 30, 2015
@fabpot fabpot changed the title [Validator] removed deprecated features in Constraints [Validator] removed deprecated features in Validator and Form Sep 30, 2015
@xabbuh
Copy link
Member

xabbuh commented Sep 30, 2015

Seems that tests in the Form component are failing on the 2.8 build.

@fabpot
Copy link
Member Author

fabpot commented Sep 30, 2015

@xabbuh #16033 should fix that.

@@ -86,7 +73,6 @@ public function configureOptions(OptionsResolver $resolver)
));

$resolver->setNormalizer('constraints', $constraintsNormalizer);
$resolver->setNormalizer('cascade_validation', $cascadeValidationNormalizer);
Copy link
Contributor

Choose a reason for hiding this comment

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

you also need to remove the option from the defaults

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@fabpot fabpot force-pushed the validator-deprecations branch 3 times, most recently from e33de53 to 104db76 Compare October 1, 2015 07:59
@stof
Copy link
Member

stof commented Oct 1, 2015

some tests for deps=low are broken in the component (the error reporting is broken because of an issue in PHPUnit 4.8 on PHP 7)

*
* @return string The type name.
*/
public function getName();
Copy link
Member Author

Choose a reason for hiding this comment

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

Can someone confirm that this is indeed deprecated and must be removed in 3.0?

Copy link
Member

Choose a reason for hiding this comment

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

it is

@stof
Copy link
Member

stof commented Oct 1, 2015

See #16041 for the issue with PHPUnit error reporting on PHP 7

@fabpot fabpot force-pushed the validator-deprecations branch from 50a6564 to 2b10290 Compare October 1, 2015 08:39
@fabpot
Copy link
Member Author

fabpot commented Oct 1, 2015

Rebased on current master to see if PHP7 issues are fixed by @stof phpunit version change for PHP7.

@fabpot fabpot force-pushed the validator-deprecations branch 3 times, most recently from 7a871c4 to 8602e24 Compare October 1, 2015 10:26
@fabpot
Copy link
Member Author

fabpot commented Oct 1, 2015

Let's stop here for now; not all deprecations are taken care of, but most of them are. The remaining are not trivial to handle and will be part of another PR.

Ready for review: ping @symfony/deciders

@Tobion
Copy link
Contributor

Tobion commented Oct 1, 2015

Tests are failing.

@fabpot fabpot force-pushed the validator-deprecations branch from 8602e24 to aa365eb Compare October 1, 2015 12:53
@fabpot
Copy link
Member Author

fabpot commented Oct 1, 2015

hopefully, tests pass now. Let's wait for Travis.

@fabpot fabpot force-pushed the validator-deprecations branch from aa365eb to 33f3400 Compare October 1, 2015 14:21
@fabpot
Copy link
Member Author

fabpot commented Oct 1, 2015

Tests pass. Not sure about PHP 7 though.

@Tobion
Copy link
Contributor

Tobion commented Oct 1, 2015

there are only 3 failing tests now: 1 is fixed by #16050 and 2 other are unrelated security tests

Good to merge 👍

@fabpot fabpot merged commit 33f3400 into symfony:master Oct 1, 2015
fabpot added a commit that referenced this pull request Oct 1, 2015
…nd Form (fabpot)

This PR was merged into the 3.0-dev branch.

Discussion
----------

[Validator] removed deprecated features in Validator and Form

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

Commits
-------

33f3400 [Form] removed deprecated features
582f3a3 [Form] removed deprecated FormType::getName()
bfba6ca [Form] removed precision option
17cedd3 [Form] removed usage of Validator deprecated features
8fd32ba [Validator] remove the API_VERSION
2a6b629 [Validator] removed deprecated methods
925ecaf [Validator] removed deprecated features in Constraints
@fabpot fabpot mentioned this pull request Nov 16, 2015
stof added a commit that referenced this pull request Dec 5, 2015
This PR was submitted for the master branch but it was merged into the 3.0 branch instead (closes #16752).

Discussion
----------

[Form] document changes to form type interfaces

| Q             | A
| ------------- | ---
| Fixed tickets | #13407, #16024, #16724, #16749
| License       | MIT

Commits
-------

b297a0c [Form] document changes to form type interfaces
fabpot added a commit that referenced this pull request Jan 14, 2016
…ozsef)

This PR was merged into the 3.0 branch.

Discussion
----------

[Validator] Remove calls to non-existing method

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

This PR removes some useless code after #16024.

**1.** [ConstraintValidator::buildViolation()](https://github.com/symfony/symfony/blob/2.8/src/Symfony/Component/Validator/ConstraintValidator.php#L64) marked as deprecated in [2.8](https://github.com/symfony/symfony/blob/2.8/src/Symfony/Component/Validator/ConstraintValidator.php#L64), and has been removed in [3.0](https://github.com/symfony/symfony/blob/3.0/src/Symfony/Component/Validator/ConstraintValidator.php#L51).

But all the ```Symfony/Component/Validator/Constraints/*```validators still making calls to this parent method.

**2.** Correct me if I'm wrong, but this condition:
```php
$this->context instanceof ExecutionContextInterface
```
in the ```Symfony/Component/Validator/Constraints/*``` validators is useless since 3.0, because the ```$context``` can only be ```ExecutionContextInterface```. I guess the porpuse of this condition was, that in 2.8 there was a [legacy interface](https://github.com/symfony/symfony/blob/2.8/src/Symfony/Component/Validator/Context/ExecutionContextInterface.php#L63) too.

And AFAIK, the ```$context``` is [always initialized](https://github.com/symfony/symfony/blob/3.0/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php#L842) before validation, so no need to check that ```$context``` is whether null or not.

**3.** The return value of [ExecutionContextInterface::getViolations()](https://github.com/symfony/symfony/blob/3.0/src/Symfony/Component/Validator/Context/ExecutionContextInterface.php#L239), is in a different namespace, so it should be used.

Commits
-------

37fb4e2 Remove calls to non-existing method
ogizanagi added a commit that referenced this pull request Jul 24, 2017
…straints (Koc)

This PR was merged into the 3.2 branch.

Discussion
----------

[Form]  Removed references for non existent validator constraints

| Q             | A
| ------------- | ---
| Branch?       | 3.2
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | follow-up of #16024
| License       | MIT
| Doc PR        | -

<!--
- Bug fixes must be submitted against the lowest branch where they apply
  (lowest branches are regularly merged to upper ones so they get the fixes too).
- Features and deprecations must be submitted against the 3.4,
  legacy code removals go to the master branch.
- Please fill in this template according to the PR you're about to submit.
- Replace this comment by a description of what your PR is solving.
-->

Commits
-------

bfd9c2c Removed references for non existent validator constraints
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