Problem/Motivation

#3557877: Use autowiring wherever possible to remove create() functions also resulted in reducing boilerplate for affected classes by using function parameter promotion, a PHP 8 feature. We should do the same for classes not affected by that issue.

Steps to reproduce

Proposed resolution

Use function parameter promotion for classes not affected by #3557877: Use autowiring wherever possible to remove create() functions

Sequencing of this and that issue is irrelevant.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork crm-3567396

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

jdleonard created an issue. See original summary.

jdleonard’s picture

Assigned: jdleonard » Unassigned
Issue summary: View changes
Status: Active » Needs review

svendecabooter made their first commit to this issue’s fork.

svendecabooter’s picture

I like this approach. Takes up less space and looks less unnecessarily verbose.
There was a PHPStan issue reported in UserContactMappingService that I fixed.
There are still issues in that class, with variables $this->rules and $this->settings.
These weren't defined before this change, so not sure what should happen here. Is this handled in another ticket?

svendecabooter’s picture

svendecabooter’s picture

Added related issue

jdleonard’s picture

Status: Needs review » Reviewed & tested by the community

Did PhpStan complain that $entityTypeManager should be made protected in the constructor? I erred on the side of not promoting it to a class variable because it is only used in the constructor. Regardless, that's a minor nit and happy for this to go as-is.

svendecabooter’s picture

There was some call to $this->entityTypeManager in one of the methods, which phpstan complained about.

jdleonard’s picture

Right you are! For avoidance of doubt, this remains RTBC.

bluegeek9 made their first commit to this issue’s fork.

bluegeek9 changed the visibility of the branch 1.0.x to hidden.

bluegeek9’s picture

Status: Reviewed & tested by the community » Fixed
//www.flaticon.com/free-icons/thank-you Thank you for your contribution! Your continued support makes this project sustainable.
There are multiple ways to show appreciation for the work contributed to this project including:
  • Triage issues and adding more context to existing issues.
  • Flagging CRM as a favorite on the project page to help others discover it and show your support.
  • Review the Developer Docs for accuracy and clarity.

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.

Status: Fixed » Closed (fixed)

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