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

PHPCS: nullable types PHP 8.4 #630

Merged
merged 1 commit into from
Aug 21, 2024
Merged

Conversation

andypost
Copy link
Contributor

First part for #624

Copy link
Member

@stof stof left a comment

Choose a reason for hiding this comment

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

This PR should also fix the new deprecations reported by a optional argument before required ones (which was skipped when the default value was making the type nullable implicitly).

Note that PHP-CS-Fixer has a (risky) rule no_unreachable_default_argument_value for that as well

@@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ["7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"]
php: ["7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4"]
Copy link
Member

Choose a reason for hiding this comment

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

This should not be done in this PR applying a CS change (especially as it does not work as is). Keep this PR focused only on the CS change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed the change, supposed to try run pipelines

Copy link
Member

Choose a reason for hiding this comment

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

I opened #631 to add new CI jobs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rebased on top of it

php-cs-fixer fix . --rules nullable_type_declaration_for_default_null_value,no_unreachable_default_argument_value --allow-risky=yes
@jrfnl
Copy link
Contributor

jrfnl commented Aug 21, 2024

This PR should also fix the new deprecations reported by a optional argument before required ones (which was skipped when the default value was making the type nullable implicitly).

I scanned this branch with PHPCompatibility, which can check for both deprecations and this branch is clean of both of those issues.

Edit: at least it is at this time (when I scanned it).

@stof
Copy link
Member

stof commented Aug 21, 2024

Edit: at least it is at this time (when I scanned it).

It was not the case when I asked for that change, as shown by the static analysis CI job at that time: https://github.com/phpspec/prophecy/actions/runs/10492742258/job/29065879468

@stof stof merged commit ae18dbc into phpspec:master Aug 21, 2024
11 checks passed
@stof stof added the PHP8.4 label Aug 21, 2024
@andypost andypost deleted the 624-phpcs-fixes branch August 21, 2024 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants