Sylius version affected: 1.8
Description
I get this exception and more similar when I have Symfony serializer 4.4 installed:
Compile Error: Declaration of Sylius\Bundle\ApiBundle\Swagger\ShopAuthenticationTokenDocumentationNormalizer::normalize($object, ?string $format = NULL, array $context = Array) must be compatible with Symfony\Component\Serializer\Normalizer\NormalizerInterface::normalize($object, $format = NULL, array $context = Array)
Steps to reproduce
composer update --prefer-lowestbin/consolePossible Solution
Either make the normalizers and denormalizers compatible with Symfony serializer v4.4 or do a composer req symfony/serializer:"^5.0". I'd vote for the former solution.
Related
The same is true for Symfony property info component where I have this exception:
Compile Error: Declaration of Sylius\Bundle\ApiBundle\PropertyInfo\Extractor\EmptyPropertyListExtractor::getProperties(string $class, array $context = Array): ?array must be compatible with Symfony\Component\PropertyInfo\PropertyListExtractorInterface::getProperties($class, array $context = Array)
We also have this problem in the Clerk plugin
I can confirm this one
CI is passing because symfony/serializer is getting installed at 5.1. Nowhere in any Sylius package is a direct dependency to the Serializer component being declared, which is problematic in its own right because you're relying on it being included through transient dependencies.
Yes @mbabker you鈥檙e totally right. And is for this kind of issues that I provided the https://github.com/Sylius/Sylius/pull/10664 PR, but it has never been merged...
Hey folks, PropertyInfor was already fixed at #11911. The same should happen for serializers. In addition, @mmenozzi can we revive your PR?
Sure @lchrusciel. Let me know how I can help.
I believe #11981 solved the issue for now :)
Most helpful comment
I believe #11981 solved the issue for now :)