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

Suggestion for lazy service #355

Merged
merged 2 commits into from
Apr 16, 2024
Merged

Suggestion for lazy service #355

merged 2 commits into from
Apr 16, 2024

Conversation

vjik
Copy link
Member

@vjik vjik commented Mar 3, 2024

No description provided.

Copy link

what-the-diff bot commented Mar 3, 2024

PR Summary

  • Modification of src/Container.php
    In this file, the addDefinition method was updated with a removed type annotation comment. This comment is no longer required for the program's functionality.
  • Enhancement of decorateLazy Method
    The decorateLazy method was updated significantly to improve its versatility and performance:
    • It now sets a variable, $class, based on the existence of a certain class or interface.
    • The method checks whether the $definition is an array, and if the IS_PREPARED_ARRAY_DEFINITION_DATA key is set. If so, it generates an ArrayDefinition object. However, if the class name is absent it will utilize the $class variable.
    • If the two conditions above are not met, it assigns $definition to the $preparedDefinition variable.
    • Ultimately, it returns a new LazyDefinition object constructed using the $preparedDefinition and $class components.
  • Neglected Code Comments
    While there were other changes in the form of code comment adjustments, they were not prioritized in this summary being less crucial to understanding the overall progress.

In simpler terms, this PR implements improvements on the decorateLazy method, which should enhance performance and versatility, besides a minor change on the addDefinition method.

Copy link

codecov bot commented Mar 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.57%. Comparing base (fedff5e) to head (757989e).

Additional details and impacted files
@@                 Coverage Diff                 @@
##             lazy-services     #355      +/-   ##
===================================================
+ Coverage            98.54%   98.57%   +0.02%     
- Complexity             168      171       +3     
===================================================
  Files                   11       11              
  Lines                  481      491      +10     
===================================================
+ Hits                   474      484      +10     
  Misses                   7        7              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@xepozz xepozz merged commit 51fefa2 into lazy-services Apr 16, 2024
31 of 32 checks passed
@xepozz xepozz deleted the lazy-suggestion branch April 16, 2024 15:57
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.

None yet

2 participants