Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
custom encoders interface signature#11439
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Fixes the documentation about encoders that was wrong.Using `Symfony\Component\Serializer\Encoder\EncoderInterface` no `$context` parameter is passed to `supportsEncoding` method. YOu have to use the ContextAware version of it.
| ..tip:: | ||
| If you need access to ``$context`` in your ``supportsDecoding`` or ``supportsEncoding`` method, make sure | ||
| to implements ``Symfony\Component\Serializer\Encoder\ContextAwareEncoderInterface`` or ``Symfony\Component\Serializer\Encoder\ContextAwareEncoderInterface`` interface |
OskarStarkApr 15, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
| toimplements ``Symfony\Component\Serializer\Encoder\ContextAwareEncoderInterface`` or ``Symfony\Component\Serializer\Encoder\ContextAwareEncoderInterface``interface | |
| toimplement ``Symfony\Component\Serializer\Encoder\ContextAwareDecoderInterface`` or ``Symfony\Component\Serializer\Encoder\ContextAwareEncoderInterface``accordingly. |
Why the same interface twice?
and a . (Dot) is missing at the end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Ah I found out by myself,Decoder andEncoder....
OskarStark commentedMay 24, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
... and one more bug fixed, thank you Florian and congratulations on your first contribution to the Symfony-Docs 🎉 ❗️ |
This PR was merged into the 4.2 branch.Discussion----------custom encoders interface signatureFixes the documentation about encoders that was wrong.Using `Symfony\Component\Serializer\Encoder\EncoderInterface` no `$context` parameter is passed to `supportsEncoding` method. You have to use the ContextAware version of it.<!--If your pull request fixes a BUG, use the oldest maintained branch that containsthe bug (seehttps://symfony.com/roadmap for the list of maintained branches).If your pull request documents a NEW FEATURE, use the same Symfony branch wherethe feature was introduced (and `master` for features of unreleased versions).-->Commits-------754a62b custom encoders interface signature
* 4.2: Tweaks. refs#11439 custom encoders interface signature
* 4.3: Tweaks. refs#11439 custom encoders interface signature
Uh oh!
There was an error while loading.Please reload this page.
Fixes the documentation about encoders that was wrong.
Using
Symfony\Component\Serializer\Encoder\EncoderInterfaceno$contextparameter is passed tosupportsEncodingmethod. You have to use the ContextAware version of it.