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

[Part 2] Modernise code #92

Merged
merged 8 commits into from
Apr 24, 2024
Merged

[Part 2] Modernise code #92

merged 8 commits into from
Apr 24, 2024

Conversation

ryanmab
Copy link

@ryanmab ryanmab commented Apr 24, 2024

Description

Continuation of: #91

This does:

  1. Bumps to PHPUnit 10 (preferable for some rector rules - and okay to move to after the changes in Part 1)
  2. Applies Rector rules for PHP up to 8.2 (what is now listed in the composer file)
  3. Applies Rector rules for PHPUnit up to 10
  4. Applies some standard Rector rules for code hygiene (mostly removing docblocks which aren't needed and adding types which are supported)
  5. Adds Rector to CI pipeline (to run code hygiene rules)

Testing Notes

Will hook this up to the platform locally before merging and test both Part 1 and 2 together. Once thats done, I'll get merging!

$this,
'mapFieldsToIds',
],
$this->mapFieldsToIds(...),
Copy link
Author

@ryanmab ryanmab Apr 24, 2024

Choose a reason for hiding this comment

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

Thought I was passed the point of finding new PHP syntax I didn't know, but apparently not. Have double checked, these are definitely equivalent.

image

Choose a reason for hiding this comment

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

interesting indeed! Apparently it's a first class callable:

same semantics as Closure::fromCallable()

@ryanmab ryanmab self-assigned this Apr 24, 2024
@ryanmab ryanmab marked this pull request as ready for review April 24, 2024 11:10
@ryanmab ryanmab requested a review from a team as a code owner April 24, 2024 11:10
@ryanmab ryanmab requested review from ohallors and gabriel-breda and removed request for a team April 24, 2024 11:10
Base automatically changed from chore/modernise-package to master April 24, 2024 11:57
Copy link

@gabriel-breda gabriel-breda left a comment

Choose a reason for hiding this comment

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

All good, not much to add.
I guess there is a bit of risk with the added type, in case we weren't following exactly what we're supposed to have. But it's good to have them and we can hope the tests would catch those cases before going to prod 🤞

Comment on lines +44 to +45
"name": "Ryan Maber",
"email": "ryan.maber@mention-me.com"

Choose a reason for hiding this comment

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

definitely controversial! 😉

Copy link
Author

Choose a reason for hiding this comment

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

This is the most important part of this PR! 😜

@ryanmab ryanmab merged commit 9e44098 into master Apr 24, 2024
1 check passed
@ryanmab ryanmab deleted the chore/rector-towards-php-8 branch April 24, 2024 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants