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

Allow autowiring serializer #568

Merged
merged 4 commits into from
May 4, 2017
Merged

Allow autowiring serializer #568

merged 4 commits into from
May 4, 2017

Conversation

Tobion
Copy link
Contributor

@Tobion Tobion commented May 3, 2017

To get rid of

Autowiring services based on the types they implement is deprecated since Symfony 3.3 and won't be supported in version 4.0. You should rename (or alias) the "jms_serializer.serializer" service to "JMS\Serializer\SerializerInterface" instead.

See symfony/symfony#22295 and symfony/symfony#22098

@goetas
Copy link
Collaborator

goetas commented May 4, 2017

Hi, thanks for the PR.

What about adding an alias also for ArrayTransformerInterface ?

Can you add some tests?
Checking the alias existence in JMSSerializerExtensionTest::testLoad() should be enough.

@goetas goetas added this to the v1.5 milestone May 4, 2017
@goetas goetas self-requested a review May 4, 2017 10:01
@Tobion
Copy link
Contributor Author

Tobion commented May 4, 2017

Good catch. Added ArrayTransformerInterface and tests.

@@ -223,6 +223,8 @@ public function testLoad()
$versionedObject = new VersionedObject('foo', 'bar');
$serializer = $container->get('serializer');

$this->assertTrue($container-has('JMS\Serializer\SerializerInterface'), 'Alias should be defined to allow autowiring');
Copy link
Collaborator

Choose a reason for hiding this comment

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

-> instead of -

@goetas
Copy link
Collaborator

goetas commented May 4, 2017

tests failed because of #568 (comment)

@Tobion
Copy link
Contributor Author

Tobion commented May 4, 2017

Fixed

@goetas goetas merged commit 8e37f49 into schmittjoh:master May 4, 2017
@goetas
Copy link
Collaborator

goetas commented May 4, 2017

thanks

@Tobion Tobion deleted the patch-1 branch May 4, 2017 20:36
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.

2 participants