FriendsOfSymfony / FOSRestBundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony
http://symfony.com/doc/master/bundles/FOSRestBundle/index.html
MIT License
2.79k stars 707 forks source link

Fix compatibility with PHP 8.1 #2337

Closed W0rma closed 2 years ago

W0rma commented 2 years ago

The remaining deprecation warnings in the PHP 8.1 pipeline will be fixed by the following PRs:

1x: PHPUnit\Runner\DefaultTestResultCache implements the Serializable interface, which is deprecated. Implement serialize() and unserialize() instead (or in addition, if support for old PHP versions is necessary) 1x in DebugClassLoader::loadClass from Symfony\Component\ErrorHandler

--> https://github.com/symfony/symfony/pull/43200 (PHPUnit 9.5 instead of PHPUnit 9.4 will be used)

2x: substr_count(): Passing null to parameter #1 ($haystack) of type string is deprecated 1x in FormatListenerTest::testOnKernelControllerNegotiation from FOS\RestBundle\Tests\EventListener 1x in FormatListenerTest::testUseSpecifiedFormat from FOS\RestBundle\Tests\EventListener

--> https://github.com/symfony/symfony/pull/43357

1x: JMS\SerializerBundle\DependencyInjection\Compiler\ServiceMapPass implements the Serializable interface, which is deprecated. Implement serialize() and unserialize() instead (or in addition, if support for old PHP versions is necessary) 1x in DependencyInjectionTest::testSerializerRelatedServicesAreNotRemovedWhenJmsSerializerBundleIsEnabled from FOS\RestBundle\Tests\Functional

--> https://github.com/schmittjoh/JMSSerializerBundle/pull/872

goetas commented 2 years ago

@W0rma does it mean that we need to wait for https://github.com/symfony/symfony/pull/43200 to be released to have the pipeline green?

W0rma commented 2 years ago

@goetas I guess the pipeline won't get green unless all three mentioned PRs are released.

goetas commented 2 years ago

ok, moving it to 3.2

mbabker commented 2 years ago

--> symfony/symfony#43200 (PHPUnit 9.5 instead of PHPUnit 9.4 will be used)

For that one, you should be able to set the SYMFONY_PHPUNIT_VERSION var either in the Actions config or phpunit.xml, it shouldn't need to wait for an upstream release for a changed default value.

W0rma commented 2 years ago

@goetas After considering the latest symfony and jms-serializer-bundle releases the PHP 8.1 is now green :)

goetas commented 2 years ago

thank you @W0rma !