doctrine / DoctrineModule

Doctrine Module for Laminas
http://www.doctrine-project.org/projects/doctrine-module.html
MIT License
398 stars 269 forks source link

Enable unit tests to work with PHP 8.0 #739

Closed driehle closed 3 years ago

driehle commented 3 years ago

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 commented 3 years ago

Rebased before merging