deprecation warnings not emitted
staabm opened this issue · comments
Describe the bug
In CI no deprecation warnings are emitted per default
Version
- I have checked releases, and the bug exists in the latest patch version of
v1
orv2
. -
v2
-
v1
Runners
- GitHub Hosted
- Self Hosted
Operating systems
ubuntu-latest
PHP versions
8.x
To Reproduce
- checkout commit nikic/PHP-Parser@71a8b79
- run the "tests" action job
Expected behavior
php should emit a deprecation warning and the pipeline should fail with
There was 1 error:
1) PhpParser\PrettyPrinterTest::testFormatPreservingPrint with data set "home/runner/work/PHP-Parser/PHP-Parser/test/code/formatPreservation/emptyListInsertion.test#2" ('Inserting into an empty list ....test)', '<?php\nfoo\n();\n\n$foo->\nba...oo {};', '$stmts[0]->expr->args[] = new...('b');', '<?php\nfoo\n($a, $b);\n\n$foo...oo {};', null)
Optional parameter $extends declared before required parameter $attributes is implicitly treated as a required parameter
/home/runner/work/PHP-Parser/PHP-Parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php:33
/home/runner/work/PHP-Parser/PHP-Parser/lib/PhpParser/PrettyPrinterAbstract.php:542
/home/runner/work/PHP-Parser/PHP-Parser/lib/PhpParser/PrettyPrinterAbstract.php:672
/home/runner/work/PHP-Parser/PHP-Parser/lib/PhpParser/PrettyPrinterAbstract.php:900
/home/runner/work/PHP-Parser/PHP-Parser/lib/PhpParser/PrettyPrinterAbstract.php:494
/home/runner/work/PHP-Parser/PHP-Parser/test/PhpParser/PrettyPrinterTest.php:249
to make the CI fail I had to add E_ALL error level manually, which I expected to be the default
without my fix it just did not emit the deprecation warning and unexpectedly succeeded
@staabm
Yes, by default it is using the production php.ini. I cannot change it without a major version bump, so this will change in v3
.
Till then, you can use the ini-file
file input and set it to development
for better defaults for a CI environment.
https://github.com/shivammathur/setup-php#ini-file-optional
ohh nice, thank you.
I am a long time user of this great action and never realised.. maybe it needs to be more prominent in the README?