-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Right now we try to support PHP 8.4 down to PHP 7.2, but especially PHP 8.4 marked many features as deprecated that affect our dev dependencies. Even though the whole idea of deprecation notices is that one can safely ignore them, the Psalm developers felt the need to bail when PHP throws a deprecation notice - even in production environments (which are other project's dev environments). So, Psalm 4 bails with the following error on PHP 8.4:
PHP Deprecated: Constant E_STRICT is deprecated in /home/runner/work/phpunit-array-asserts/phpunit-array-asserts/vendor/vimeo/psalm/src/Psalm/Internal/ErrorHandler.php on line 53
Deprecated: Constant E_STRICT is deprecated in /home/runner/work/phpunit-array-asserts/phpunit-array-asserts/vendor/vimeo/psalm/src/Psalm/Internal/ErrorHandler.php on line 53
Uncaught RuntimeException: PHP Error: Psalm\Internal\Provider\FileProvider::getFilesInDir(): Implicitly marking parameter $filter as nullable is deprecated, the explicit nullable type must be used instead in /home/runner/work/phpunit-array-asserts/phpunit-array-asserts/vendor/vimeo/psalm/src/Psalm/Internal/Provider/FileProvider.php:123 in /home/runner/work/phpunit-array-asserts/phpunit-array-asserts/vendor/vimeo/psalm/src/Psalm/Internal/ErrorHandler.php:66
Stack trace:
#0 /home/runner/work/phpunit-array-asserts/phpunit-array-asserts/vendor/composer/ClassLoader.php(576): Psalm\Internal\ErrorHandler::{closure:Psalm\Internal\ErrorHandler::installErrorHandler():59}()
#1 /home/runner/work/phpunit-array-asserts/phpunit-array-asserts/vendor/composer/ClassLoader.php(576): include()
#2 /home/runner/work/phpunit-array-asserts/phpunit-array-asserts/vendor/composer/ClassLoader.php(427): {closure:Composer\Autoload\ClassLoader::initializeIncludeClosure():575}()
#3 /home/runner/work/phpunit-array-asserts/phpunit-array-asserts/vendor/vimeo/psalm/src/Psalm/Internal/Cli/Psalm.php(628): Composer\Autoload\ClassLoader->loadClass()
#4 /home/runner/work/phpunit-array-asserts/phpunit-array-asserts/vendor/vimeo/psalm/src/Psalm/Internal/Cli/Psalm.php(325): Psalm\Internal\Cli\Psalm::initProviders()
#5 /home/runner/work/phpunit-array-asserts/phpunit-array-asserts/vendor/vimeo/psalm/psalm(7): Psalm\Internal\Cli\Psalm::run()
#6 /home/runner/work/phpunit-array-asserts/phpunit-array-asserts/vendor/bin/psalm(119): include('...')
#7 {main}
(Psalm 4.30.0@d0bc6e25d89f649e4f36a534f330f8bb4643dd69 crashed due to an uncaught Throwable)
I'm not aware of a way to make Psalm 4 work with PHP 8.4, the only solution seems to be to update to a newer Psalm version. However, newer Psalm versions no longer support PHP 7.2. So we either have to drop support for older PHP versions, something I don't want to do right now (not until PHPUnit 8 reaches its end-of-life, see https://phpunit.de/supported-versions.html), or use a different set of dev dependencies depending on the PHP versions (i.e. use newer Psalm versions on newer PHP versions, but keep on using old Psalm versions on old PHP versions).
Until this is implemented I've disabled Psalm with PHP 8.4 in 841db9a
Help fixing this is very welcome! 👍