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

Injection lazy loading #107

Merged
merged 9 commits into from
May 14, 2024
Merged

Injection lazy loading #107

merged 9 commits into from
May 14, 2024

Conversation

vjik
Copy link
Member

@vjik vjik commented May 3, 2024

Q A
Is bugfix?
New feature? ✔️
Breaks BC?

@vjik vjik requested a review from a team May 3, 2024 09:12
@vjik vjik added the status:code review The pull request needs review. label May 3, 2024
Copy link

codecov bot commented May 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (d323372) to head (5370601).
Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##              master      #107   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity        84        92    +8     
===========================================
  Files              7         9    +2     
  Lines            246       264   +18     
===========================================
+ Hits             246       264   +18     

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

Copy link
Member

@Tigrov Tigrov left a comment

Choose a reason for hiding this comment

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

Also better add FQN

src/ViewRenderer.php Outdated Show resolved Hide resolved
src/InjectionContainerInterface.php Outdated Show resolved Hide resolved
src/InjectionContainer.php Outdated Show resolved Hide resolved
@vjik vjik requested a review from Tigrov May 3, 2024 12:04
README.md Outdated Show resolved Hide resolved

use Psr\Container\ContainerInterface;

final class InjectionContainer implements InjectionContainerInterface
Copy link
Member

Choose a reason for hiding this comment

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

Looks like a dummy class that does nothing. Can we avoid it?

Copy link
Member Author

Choose a reason for hiding this comment

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

We can use directly PSR container instead of it. But there are disadvantages:

  1. unnecessary method has()
  2. method get() returns mixed, so we should check that it is object and throw exception if no.

src/ViewRenderer.php Outdated Show resolved Hide resolved
src/ViewRenderer.php Outdated Show resolved Hide resolved
src/ViewRenderer.php Outdated Show resolved Hide resolved
src/ViewRenderer.php Outdated Show resolved Hide resolved
@vjik vjik merged commit 75d6981 into master May 14, 2024
23 checks passed
@vjik vjik deleted the lazy-injections branch May 14, 2024 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:code review The pull request needs review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants