Comments (5)
There are tests for this.
If you think it is not working please try to add a failing, reproducible test case.
from jmsdiextrabundle.
Closing as no further feedback was provided.
from jmsdiextrabundle.
For anyone else experiencing this problem; I never solved it, and don't have the time to test, it's easy enough to work around, I've just avoided using customised automatic injection.
from jmsdiextrabundle.
Having tried to use this another another unrelated project, I'm still convinced they're broken.
Attempted to run the tests on the bundle, but I couldn't get them working, whilst PHPUnit is not something I'm that familiar with– amongst the errors was "missing JMS\DiExtraBundle\Finder\ServiceFinder in PerformanceTest", which doesn't seem to exist in the bundle, I searched the entire project.
Either way, the chances of me understanding this and debugging the problem is slim, DI is hard– I just wanted to report what I think is a problem.
from jmsdiextrabundle.
I just worked out why I couldn't get this working, I was using it completely wrong, I expected this functionality to build on the magic that happens when you do:
public function indexAction(Request $request) {}
So that I could simply do:
public function indexAction(MyAPIClient $api_client, Request $request) {}
As opposed to simply populating properties set on the class.
protected $api_client
public function indexAction(Request $request) {
var_dump($api_client); // my service
}
I think I mostly fell into this because the example provided in http://jmsyst.com/bundles/JMSDiExtraBundle/master/configuration#automatic-controller-injections is for @request
and @router
, where @request
you'd typically use in a controller as above rather than inject it to a property
It wasn't until I recently read through the tests that I worked out how this was meant to be used, perhaps this could be made clearer in the documentation.
from jmsdiextrabundle.
Related Issues (20)
- Symfony autowiring broken by JMSDiExtraBundle HOT 8
- Container cache miss occurs on tests since Symfony 3.2.
- Unable to reset entity manager with doctrine_integration enabled HOT 1
- Getting error after updating to #55c3f875f08a333848284cdbc1fd3e0cea4e6776 HOT 22
- addClassesToCompile() is deprecated since Symfony version 3.3, to be removed in 4.0 HOT 4
- Parent definition does not exist HOT 4
- Implement the new !tagged functionality
- Translation WebInterface: Unable to find template "@JMSTranslation/translate/index.html.twig" HOT 2
- Symfony 3.4 HOT 3
- Doctrine orm service must be true by default HOT 2
- Annotations not working when using PHP through FastCGI HOT 3
- Compatible with Symfony4 require HOT 2
- Unrecognized options HOT 1
- Cache clear, cannot declare class HOT 2
- IOException with Paratest HOT 3
- Symfony 4 support HOT 5
- Call to a member function has() on null HOT 6
- Symfony 3.4 setScope Call to undefined method HOT 2
- Support for "jms/metadata": "^2.0"
- PHP 8 support HOT 1
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 jmsdiextrabundle.