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

Deprecated usage of ValidatorInterface #438

Closed
soullivaneuh opened this issue Apr 27, 2015 · 7 comments
Closed

Deprecated usage of ValidatorInterface #438

soullivaneuh opened this issue Apr 27, 2015 · 7 comments

Comments

@soullivaneuh
Copy link
Contributor

Concerned file: https://github.com/schmittjoh/serializer/blob/master/src/JMS/Serializer/EventDispatcher/Subscriber/SymfonyValidatorSubscriber.php#L30

Related notice:

 * @deprecated since version 2.5, to be removed in 3.0.
 *             Use {@link \Symfony\Component\Validator\ValidatorInterface} instead.

As this class is passed on the constructor, don't really know how to manage it.

Maybe create a legacy class? Where this class is used?

Regards

@schmittjoh
Copy link
Owner

Not sure this message makes sense, we are already using this interface?

@soullivaneuh
Copy link
Contributor Author

Seems yes. See your SymfonyValidatorSubscriber class. 👍

@stof
Copy link
Contributor

stof commented Sep 8, 2015

Well, given the API used in this subscriber, it is very easy to support both the old and the new validator interfaces: just accept both in the constructor. The API used in the code is common to both versions (the old API has more optional args in its validate() method, but the subscriber does not use them)

@soullivaneuh
Copy link
Contributor Author

@stof Yes, but it use groups arguments that is not the second parameter on the new interface. Have to check that.

@stof
Copy link
Contributor

stof commented Sep 9, 2015

Ah indeed. I missed the fact that the second argument was used. It is the third argument in the new API.
This can easily be checked with an instanceof check to switch between API.

@soullivaneuh
Copy link
Contributor Author

@stof yes. I did it on #491.

@goetas
Copy link
Collaborator

goetas commented Dec 30, 2016

solved in #682

@goetas goetas closed this as completed Dec 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants