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

CI should fail on PHP deprecated errors and report errors for deprecated implicit float to int precision loss #10958

Draft
wants to merge 5 commits into
base: 5.x
Choose a base branch
from

Conversation

kkmuffme
Copy link
Contributor

@kkmuffme kkmuffme commented May 5, 2024

Fix #10957
Fix #10950
Fix #10949

Update parts of CI to use PHP 8.3 instead of older PHP versions.

@staabm
Copy link
Contributor

staabm commented May 5, 2024

In my experience you also need to set a proper php.ini in the github action.

See e.g. nikic/PHP-Parser@f2e037f

@kkmuffme kkmuffme changed the title CI should fail on PHP deprecated errors CI should fail on PHP deprecated errors and report errors for deprecated implicit float to int precision loss May 5, 2024
@kkmuffme kkmuffme force-pushed the fix-php-deprecated-notices-not-reported branch from 9784367 to b20b36d Compare May 5, 2024 18:38
@kkmuffme kkmuffme marked this pull request as ready for review May 5, 2024 18:43
@kkmuffme
Copy link
Contributor Author

kkmuffme commented May 5, 2024

@staabm thanks for your comment, saved me some time. Just adding the error_reporting ini value turned out to be sufficient though.


Ready to review and merge.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@@ -54,8 +54,8 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
ini-values: zend.assertions=1, assert.exception=1, opcache.enable_cli=1, opcache.jit=function, opcache.jit_buffer_size=512M
php-version: '8.3'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would actually prefer this lowered to 7.4

Copy link
Contributor Author

@kkmuffme kkmuffme May 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done + also added a CI for PHP 7.4 in linux. There are a couple bugs as seen with the failing tests.

Additionally, there is a bug in delta loading - when running psalm with PHP 7.4 but a phpVersion > 7.4, it won't load delta and psalm reports various incorrect errors (e.g. for get_headers 2nd arg it asks for int, which is wrong in PHP 8)
There are lots of issues related to these in tests, some of which I fixed in pending to be merged PRs e.g. #10813 and #10777
(bc then I can also finish #10771 which fixes part of that issue too)

Could you please go ahead and merge those PRs?

I'll revert the CI to not run with 7.4 and set Windows to 8.0 again in this PR once I hear back from you, so it can be merged already and implement the 7.4 CI in #10771

@kkmuffme kkmuffme force-pushed the fix-php-deprecated-notices-not-reported branch from 78c3b17 to 896e115 Compare May 5, 2024 20:25
@kkmuffme kkmuffme marked this pull request as draft May 5, 2024 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants