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

[3.x] chore: remove support of PHP 7.4 and 8.0 #280

Conversation

alexislefebvre
Copy link
Collaborator

@alexislefebvre alexislefebvre commented Mar 10, 2024

@alexislefebvre alexislefebvre added this to the 3.x milestone Mar 10, 2024
@alexislefebvre alexislefebvre force-pushed the chore-remove-support-of-php-7.4-and-8.0-3.x branch from f1e2c1f to 36feabe Compare March 10, 2024 16:28
@alexislefebvre alexislefebvre force-pushed the chore-remove-support-of-php-7.4-and-8.0-3.x branch 4 times, most recently from a4a2cd3 to 802e545 Compare March 10, 2024 17:11
@alexislefebvre alexislefebvre force-pushed the chore-remove-support-of-php-7.4-and-8.0-3.x branch 4 times, most recently from 96cb584 to c0b57fa Compare March 10, 2024 17:44
@alexislefebvre alexislefebvre force-pushed the chore-remove-support-of-php-7.4-and-8.0-3.x branch 3 times, most recently from 39d5791 to 5352aa5 Compare March 10, 2024 18:18
@alexislefebvre
Copy link
Collaborator Author

alexislefebvre commented Mar 10, 2024

There was an issue with the MongoDB test with composer update --prefer-lowest because it installed doctrine/mongodb-odm-bundle 4.x and there was an error that I can't reproduce.

It randomly appeared when I ran docker-compose exec php-fpm ./vendor/bin/phpunit tests/Test/ConfigMongodbTest.php --debug several times.

The minimal version for doctrine/mongodb-odm-bundle is now 5.0.


Update: here is the error (?):

$ docker-compose exec php-fpm ./vendor/bin/phpunit tests/Test/ConfigMongodbTest.php --debug
PHPUnit Started (PHPUnit 10.5.11 using PHP 8.1.27 (cli) on Linux)
Test Runner Configured
Test Suite Loaded (1 test)
Event Facade Sealed
Test Runner Started
Test Suite Sorted
Test Runner Execution Started (1 test)
Test Suite Started (Liip\Acme\Tests\Test\ConfigMongodbTest, 1 test)
Test Errored (Liip\Acme\Tests\Test\ConfigMongodbTest::testLoadFixturesMongodb)
Deprecated: Return type of Doctrine\ODM\MongoDB\APM\CommandLogger::commandStarted(MongoDB\Driver\Monitoring\CommandStartedEvent $event) should either be compatible with MongoDB\Driver\Monitoring\CommandSubscriber::commandStarted(MongoDB\Driver\Monitoring\CommandStartedEvent $event): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /application/vendor/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/APM/CommandLogger.php on line 47
Deprecated: Return type of Doctrine\ODM\MongoDB\APM\CommandLogger::commandSucceeded(MongoDB\Driver\Monitoring\CommandSucceededEvent $event) should either be compatible with MongoDB\Driver\Monitoring\CommandSubscriber::commandSucceeded(MongoDB\Driver\Monitoring\CommandSucceededEvent $event): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /application/vendor/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/APM/CommandLogger.php on line 52
Deprecated: Return type of Doctrine\ODM\MongoDB\APM\CommandLogger::commandFailed(MongoDB\Driver\Monitoring\CommandFailedEvent $event) should either be compatible with MongoDB\Driver\Monitoring\CommandSubscriber::commandFailed(MongoDB\Driver\Monitoring\CommandFailedEvent $event): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /application/vendor/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/APM/CommandLogger.php on line 62
Test Suite Finished (Liip\Acme\Tests\Test\ConfigMongodbTest, 1 test)
Test Runner Execution Finished
Test Runner Finished
PHPUnit Finished (Shell Exit Code: 2)

@alexislefebvre alexislefebvre force-pushed the chore-remove-support-of-php-7.4-and-8.0-3.x branch from 5352aa5 to 7277290 Compare March 10, 2024 18:25
@alexislefebvre
Copy link
Collaborator Author

We need processIsolation="true" or #[RunTestsInSeparateProcesses] because different kernels are loaded, but it hides errors and PHPUnit report successful tests as deprecated instead of success.

@alexislefebvre
Copy link
Collaborator Author

There was an issue with the MongoDB test with composer update --prefer-lowest because it installed doctrine/mongodb-odm-bundle 4.x and there was an error that I can't reproduce.

It randomly appeared when I ran docker-compose exec php-fpm ./vendor/bin/phpunit tests/Test/ConfigMongodbTest.php --debug several times.

The minimal version for doctrine/mongodb-odm-bundle is now 5.0.

It requires symfony/framework-bundle: ^6.4 || ^7.0 so --prefer-lowest makes less sense. 😬

@alexislefebvre alexislefebvre force-pushed the chore-remove-support-of-php-7.4-and-8.0-3.x branch 2 times, most recently from 1d91fd2 to f827766 Compare March 10, 2024 18:37
@alexislefebvre alexislefebvre changed the title chore: remove support of PHP 7.4 and 8.0 [3.x] chore: remove support of PHP 7.4 and 8.0 Mar 10, 2024
@alexislefebvre alexislefebvre force-pushed the chore-remove-support-of-php-7.4-and-8.0-3.x branch 3 times, most recently from 44fed80 to 9f9877e Compare March 10, 2024 21:49
@alexislefebvre alexislefebvre force-pushed the chore-remove-support-of-php-7.4-and-8.0-3.x branch from 9f9877e to 1f24a9f Compare March 10, 2024 22:26
@alexislefebvre
Copy link
Collaborator Author

The actual error was:

PHPUnit\Framework\Exception: Deprecated: Return type of Doctrine\ODM\MongoDB\APM\CommandLogger::commandStarted(MongoDB\Driver\Monitoring\CommandStartedEvent $event) should either be compatible with MongoDB\Driver\Monitoring\CommandSubscriber::commandStarted(MongoDB\Driver\Monitoring\CommandStartedEvent $event): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /application/vendor/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/APM/CommandLogger.php on line 47

Using "doctrine/mongodb-odm": "^2.5" fixed the issue.

@alexislefebvre alexislefebvre merged commit 9254cf9 into liip:3.x Mar 10, 2024
9 checks passed
@alexislefebvre alexislefebvre deleted the chore-remove-support-of-php-7.4-and-8.0-3.x branch March 10, 2024 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant