Skip to content

PHPCS: nullable types PHP 8.4#630

Merged
stof merged 1 commit intophpspec:masterfrom
skilld-labs:624-phpcs-fixes
Aug 21, 2024
Merged

PHPCS: nullable types PHP 8.4#630
stof merged 1 commit intophpspec:masterfrom
skilld-labs:624-phpcs-fixes

Conversation

@andypost
Copy link
Copy Markdown
Contributor

First part for #624

@andypost andypost marked this pull request as ready for review August 21, 2024 15:22
Copy link
Copy Markdown
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

Comment thread .github/workflows/build.yml Outdated
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@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