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

Enable unit tests to work with PHP 8.0 #739

Merged
merged 6 commits into from
Oct 27, 2021

Conversation

driehle
Copy link
Member

@driehle driehle commented Oct 21, 2021

This PR improves PHP 8.0 compatibility. DoctrineModule was already compatible with PHP 8.0 before, but there were some edge cases with the optional dependency laminas/laminas-mvc-console, which have not been handled.

With this PR, explicit checks for the presence of laminas/laminas-mvc-console have been added and errors are reported using trigger_error(), when non-installed components are being used.

Further, this PR removed the method \DoctrineModule\Module::getConsoleUsage() when PHP 8.0 is used. This method is used by laminas/laminas-mvc-console, which is not PHP 8.0-compatible. Hence, this method can never have been used when using PHP 8.0. For PHP 7.3 and 7.4 everything will continoue to work as before. We have discussed this issue on Slack in in the comments here and came to the conclusion that we do not consider this a BC break.

This PR targets the next minor release, i.e. 4.2.0.

Fixes #740

@driehle driehle changed the base branch from 4.1.x to 4.2.x October 21, 2021 16:30
@driehle driehle force-pushed the feature/php8-compatibility branch 2 times, most recently from 6e55ec6 to 74736b9 Compare October 21, 2021 16:32
src/Module.php Outdated Show resolved Hide resolved
@driehle driehle force-pushed the feature/php8-compatibility branch 3 times, most recently from 545f40d to bb543e8 Compare October 22, 2021 07:25
@driehle driehle marked this pull request as ready for review October 22, 2021 07:29
@driehle driehle self-assigned this Oct 22, 2021
@driehle driehle added the Bug label Oct 22, 2021
@driehle driehle added this to the 4.2.0 milestone Oct 22, 2021
@driehle driehle linked an issue Oct 22, 2021 that may be closed by this pull request
src/Controller/CliController.php Outdated Show resolved Hide resolved
src/GetConsoleUsage.php Show resolved Hide resolved
@driehle driehle merged commit 3a42268 into doctrine:4.2.x Oct 27, 2021
@driehle
Copy link
Member Author

driehle commented Oct 27, 2021

Rebased before merging

@driehle driehle deleted the feature/php8-compatibility branch October 27, 2021 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unit tests should be executed with PHP 8.0
5 participants