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

Closes #6550 Delegate creation of the dependencies to the container #7215

Open
wants to merge 49 commits into
base: develop
Choose a base branch
from

Conversation

remyperona
Copy link
Contributor

@remyperona remyperona commented Jan 6, 2025

Description

Fixes #6550

Update the service providers code to pass the dependencies aliases instead of the instances of the classes when registering the services.

Type of change

  • Chore

Detailed scenario

The change doesn't have any impact on the functionality of the plugin itself.

Technical description

Documentation

Replaced the container calls to get the instances of dependencies by passing only the aliases directly. This delegates the instances creation to the container instead of it happening in the providers.

Also update string & array dependencies declaration to use the StringArgument and ArrayArgument classes, which helps the container know directly that the type of the value passed.

Mandatory Checklist

Code validation

  • I validated all the Acceptance Criteria. If possible, provide screenshots or videos.
  • I triggered all changed lines of code at least once without new errors/warnings/notices.

Code style

  • I wrote a self-explanatory code about what it does.
  • I protected entry points against unexpected inputs.
  • I did not introduce unnecessary complexity.

@remyperona remyperona self-assigned this Jan 6, 2025
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for e726c3d1 0.00% (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (e726c3d) Report Missing Report Missing Report Missing
Head commit (70550c2) 39022 17107 43.84%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#7215) 812 0 0.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

@remyperona remyperona added performance Issues related to our code performance dev initiative labels Jan 10, 2025
@remyperona remyperona requested a review from a team January 10, 2025 20:27
@remyperona remyperona marked this pull request as ready for review January 10, 2025 20:27
Copy link
Contributor

@wordpressfan wordpressfan left a comment

Choose a reason for hiding this comment

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

For @wp-media/qa-team here we touched mostly all service providers, and this affects even thirdparty compatibility files, so good luck :D

Slack discussion to explain what we changed in that PR because we will use in our next development.

Also I believe we need to merge this ASAP not to get many conflicts while we are working on features in develop.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev initiative performance Issues related to our code performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delegate to the container the creation from dependencies
2 participants