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

deprecation warnings not emitted #827

Closed
2 of 5 tasks
staabm opened this issue Mar 17, 2024 · 2 comments
Closed
2 of 5 tasks

deprecation warnings not emitted #827

staabm opened this issue Mar 17, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@staabm
Copy link

staabm commented Mar 17, 2024

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 or v2.
  • v2
  • v1

Runners

  • GitHub Hosted
  • Self Hosted

Operating systems

ubuntu-latest

PHP versions

8.x

To Reproduce

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

@shivammathur
Copy link
Owner

shivammathur commented Mar 17, 2024

@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

@staabm
Copy link
Author

staabm commented Mar 17, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants