Comments (4)
Hi @netdust,
thanks for taking the time to open an issue.
Could you provide a minimal example to reproduce the issue?
from di52.
<?php
use lucatume\DI52\Container;
$container = new Container();
// Decorators are built left to right, outer decorators are listed first.
$container->bindDecorators(PostEndpoint::class, [
LoggingEndpoint::class,
CachingEndpoint::class,
BaseEndpoint::class
],
['add_actions']
);
$container->get(PostEndpoint::class);
This should call the add_action
method on LoggingEndpoint
first, then from there all the way to BaseEndPoint
. But instead it calls the method directly on BaseEndpoint
, skipping the decorators.
from di52.
Thanks for providing an example.
Since we're talking about the decorator pattern here, the add_actions
after-build method should be called on the outer decorator only; i.e. the LoggingEndpoint
one.
It should be, then, up to the LoggingEndpoint
to call CachingEndpoint::add_actions
that should, in turn, call the BaseEndpoint::add_actions
method.
I will look into this with this frame of mind: the add_actions
method should be called after the PostEndpoint
is built, whatever is the outer decorator.
from di52.
πthx!
from di52.
Related Issues (12)
- Dynamically injected dependency behaves like a Singleton HOT 2
- Incorrect exception thrown if failed to auto resolve nested dependency HOT 2
- Request for feedback: Define Singleton or Bind as default auto-resolve behavior when creating a new Container instance HOT 9
- Auto resolve does not respect the Singleton definition if registered as a callback HOT 4
- Composer 2 support HOT 1
- Upgrade PHP version HOT 10
- Lexical syntax error triggers an exception with message "Class does not exist" HOT 2
- Suggestion: Implement PSR-11 on DI52 3 HOT 1
- Update project's about to PHP 5.6 HOT 1
- Make compatible with StellarWP Container HOT 1
- Remove use of aliases.php
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from di52.