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

Chore: Modernize code using Rector #204

Merged
merged 3 commits into from
May 20, 2024
Merged

Chore: Modernize code using Rector #204

merged 3 commits into from
May 20, 2024

Conversation

RikudouSage
Copy link
Collaborator

@RikudouSage RikudouSage commented May 20, 2024

Description

Modernizes the code using automated tools. Most commonly adds the PHP 8.3 #[Override] attribute. The attribute checks at compile time that the method is indeed overriding something and throws an error if it's not.

Other changes include:

  • all global namespace classes are imported for consistency
  • anonymous functions have been changed to short closures where applicable
  • get_class() function call has been replaced with static ::class
  • unused caught exception variables have been removed
  • the Stringable interface is now implemented explicitly instead of implicitly

Note that all of this will be automatically reversed when releasing for older versions.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@RikudouSage RikudouSage changed the title Chore: Add Override attribute to all overriding methods Chore: Modernize code using Rector May 20, 2024
Copy link
Member

@sighphyre sighphyre left a comment

Choose a reason for hiding this comment

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

LGTM

@RikudouSage RikudouSage merged commit 91c76b8 into main May 20, 2024
12 checks passed
@RikudouSage RikudouSage deleted the chore/override branch May 20, 2024 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants