schmittjoh / serializer

Library for (de-)serializing data of any complexity (supports JSON, and XML)
http://jmsyst.com/libs/serializer
MIT License
2.32k stars 589 forks source link

Update doctrine/instantiator to v2.x for PHP 8.1 #1483

Closed JBlocks closed 1 year ago

JBlocks commented 1 year ago
Q A
Bug report? no
Feature request? yes
BC Break report? no

Steps required to reproduce the problem

  1. Using PHP >=v8.1
  2. Install jms serializer with composer composer req jms/serializer
  3. Installation failed with doctrine/instantiator[1.1.0, ..., 1.3.0] require php ^7.1 -> your php version (8.1.16) does not satisfy that requirement.

Expected Result

Actual Result

mbabker commented 1 year ago

The doctrine/instantiator package supports ^7.1 || ^8.0 as of its 1.3.1 release. Try updating that package first.

JBlocks commented 1 year ago

Thanks for the feedback. Would it still be possible to bring the jms serializer to the new version 2 of doctrine/instantiator?

We currently have to resolve some dependencies, as e.g. the new TYPO3 CMS v12 uses the doctrine/instantiator:^2 package. The CMS and third-party providers will now increasingly update to the new versions. The doctrine/orm package also uses the v2 of doctrine/instantiator.

scyzoryck commented 1 year ago

Hi. Last time when I was checking it there were some troubles with its installation - conflicts with other library. However if you have some time feel free to take a look at it and submit MR. I will be glad to help you if you would need any help. I will add this to my personal todo list too, however it is hard to estimate when I will have some time to work on that.

mbabker commented 1 year ago

I just checked a Symfony app on what requires the Instantiator package:

$ composer why doctrine/instantiator
doctrine/orm    2.14.2 requires doctrine/instantiator (^1.3)         
jms/serializer  3.23.0 requires doctrine/instantiator (^1.0.3)       
phpunit/phpunit 9.6.7  requires doctrine/instantiator (^1.3.1 || ^2)

Because doctrine/orm is a require-dev of jms/serializer, you still won't be able to install the Instantiator package with stable dependencies until ORM 2.15 ships https://github.com/doctrine/orm/pull/10351. Since there aren't CI builds with optional dependencies removed, you're better off waiting for that ORM release to add the new major to the list.

scyzoryck commented 1 year ago

doctrine/orm has been released, however to run proper tests for the serialiser there is one more blocker - https://github.com/doctrine/phpcr-odm

➜  serializer git:(master) composer why-not doctrine/instantiator 2
jms/serializer     3.x-dev requires doctrine/instantiator (^1.0.3) 
doctrine/phpcr-odm 1.7.1   requires doctrine/instantiator (^1.0.1)