Skip to content

Comments

👌🏻 Allow ServiceMatcher to be injected#234

Closed
yoan-myparcel wants to merge 1 commit intodevelopfrom
improvement/injectable-service-matcher
Closed

👌🏻 Allow ServiceMatcher to be injected#234
yoan-myparcel wants to merge 1 commit intodevelopfrom
improvement/injectable-service-matcher

Conversation

@yoan-myparcel
Copy link
Member

This pull request introduces the ServiceMatcher dependency into the MyParcelComApi class to improve service matching during API operations. The most important changes include adding the ServiceMatcher as a private member, updating constructors and methods to handle this dependency, and refactoring the getServices method to utilize the new ServiceMatcher instance.

Dependency Injection and Refactoring:

  • src/MyParcelComApi.php: Added ServiceMatcher as a private member to the MyParcelComApi class.
  • src/MyParcelComApi.php: Updated the createSingleton method to accept an optional ServiceMatcher parameter and pass it to the constructor.
  • src/MyParcelComApi.php: Modified the constructor to accept an optional ServiceMatcher parameter and set it using a new setServiceMatcher method. [1] [2]
  • src/MyParcelComApi.php: Refactored the getServices method to use the instance of ServiceMatcher instead of creating a new one.
  • src/MyParcelComApi.php: Added a setServiceMatcher method to allow setting the ServiceMatcher instance.

@yoan-myparcel
Copy link
Member Author

Closed in favor of #235

@yoan-myparcel yoan-myparcel deleted the improvement/injectable-service-matcher branch March 4, 2025 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants