Problem/Motivation

Our minimum PHP version is already 8.1 which means we can apply property promotion and remove a bunch of class properties to clean up some code.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork graphql-3586955

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

kingdutch created an issue. See original summary.

kingdutch’s picture

Assigned: kingdutch » Unassigned
Status: Active » Needs review

A mix of manual work and Cursor that I reviewed to make all the changes.

Cursor removed some unused properties, which I think is fine to do in this issue as well.

One thing I've not done which should be done in a follow-up is to fix some of the dependency injection anti-patterns that are currently present in the module, this will fail future PHPStan Drupal rules: https://mglaman.dev/blog/dependency-injection-anti-patterns-drupal. I'm leaving that to a follow-up because it's a more functional change that might require extending classes to make more changes than simply also applying constructor property promotion.

klausi’s picture

Status: Needs review » Needs work

Thanks, just minor comments on the MR.

kingdutch’s picture

Status: Needs work » Needs review
kingdutch’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • kingdutch committed 00bbcca1 on 5.x
    feat: #3586955 Apply constructor property promotion to all classes
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.