JMSSerializerBundle icon indicating copy to clipboard operation
JMSSerializerBundle copied to clipboard

Deprecation alert from jsm/serializer while using php 7.4

Open mazux opened this issue 4 years ago • 1 comments

When using 2.4.4 (latest 2.x) version of this bundle on php 7.4 environment, you will get this message:

PHP Deprecated:  Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in /app/vendor/jms/serializer/src/JMS/Serializer/SerializationContext.php on line 123

As that version is using "jms/serializer": "^1.10", and it should be upgraded to be 1.14.1 which is created to resolve that issue.

mazux avatar Aug 10 '20 11:08 mazux

I had the same problem. The version 2.4.4 of the bundle doesn't conflict with any jms/serialiser 1.* version. You can add 1.14.1 explicitly to your composer.json config by running the composer require 'jms/serializer: ^1.14.1' command.

You can also run c up jms/serializer-bundle --with-dependencies and it will update all packages the bundle requires, including jms/serializer.

Finally you can run just c up jms/serializer without declaring the explicit requirement in composer.json, which will also update the library to 1.14.1

alyamovsky avatar Sep 08 '20 16:09 alyamovsky