We should update the module's dependency injection and class constructors to use PHP 8.0 Constructor Property Promotion.Since Drupal 10+ requires PHP 8.1+, we can safely leverage this modern syntax across the codebase to reduce boilerplate code.

Issue fork poll-3592648

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

ivnish created an issue. See original summary.

berdir’s picture

You could also combine it with autowire if you touch those, requiring 10.2 should be fine now if not already done: https://www.drupal.org/node/3395716

edit: that's specifically for controllers, there are also versions for plugins but they require much more recent core versions.

ivnish’s picture

Assigned: ivnish » Unassigned
Status: Active » Needs review
bramdriesen’s picture

Status: Needs review » Reviewed & tested by the community

  • bramdriesen committed c51e70ce on 2.0.x authored by ivnish
    task: #3592648 Update constructors to "Constructor Property Promotion"...
bramdriesen’s picture

Status: Reviewed & tested by the community » 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.