Comments (7)
(Originally posted by: EvanDotPro on 03/07/12)
Confirmed this works with setter injection but not constructor injection as of dd359a2.
from zendframework.
(Originally posted by: maks3w on 08/28/12)
Still happening
from zendframework.
This issue was ported from the ZF2 Jira Issue Tracker at
http://framework.zend.com/issues/browse/ZF2-148
Known GitHub users mentioned in the original message or comment:
@hoochie-coochie, @weierophinney, @EvanDotPro, @Maks3w
from zendframework.
@drdev or @Maks3w does is this still a valid bug?
from zendframework.
I pulled down his example and ran it against develop and the same exception is thrown.
(I had to fix the autoloader and rename Zend\Di\Configuration to Zend\Di\Config to get it to run)
Fatal error: Uncaught exception 'Zend\Di\Exception\MissingPropertyException' with message 'Missing instance/object for parameter criteria for MovieApp\Finder::__construct' in zf2/library/Zend/Di/Di.php on line 826
Zend\Di\Exception\MissingPropertyException: Missing instance/object for parameter criteria for MovieApp\Finder::__construct in zf2/library/Zend/Di/Di.php on line 826
Call Stack:
0.0005 233624 1. {main}() Zend_DI-Examples/example-20.php:0
0.0132 1059288 2. Zend\Di\Di->get() Zend_DI-Examples/example-20.php:62
0.0153 1218352 3. Zend\Di\Di->newInstance() zf2/library/Zend/Di/Di.php:227
0.0155 1223752 4. Zend\Di\Di->createInstanceViaConstructor() zf2/library/Zend/Di/Di.php:278
0.0155 1224200 5. Zend\Di\Di->resolveMethodParameters() zf2/library/Zend/Di/Di.php:446
0.0156 1228616 6. Zend\Di\Di->get() zf2/library/Zend/Di/Di.php:783
0.0159 1232072 7. Zend\Di\Di->newInstance() zf2/library/Zend/Di/Di.php:227
0.0160 1233360 8. Zend\Di\Di->createInstanceViaConstructor() zf2/library/Zend/Di/Di.php:278
0.0160 1233640 9. Zend\Di\Di->resolveMethodParameters() zf2/library/Zend/Di/Di.php:446
I haven't spent any time in the Di component so I can't speak to whether it should be fixed or not. Perhaps @Ocramius or @ralphschindler could take a look?
from zendframework.
If you change your config to the following:
$config = new Zend\Di\Config(array(
'instance' => array(
'alias' => array(
'title-finder' => 'MovieApp\Finder',
),
'MovieApp\Lister' => array( // <--- here don't bind the parameter to the Abstract, only the concrete
'parameters' => array(
// Use configured finder
'finder' => 'title-finder'
),
),
'title-finder' => array(
'parameters' => array(
'criteria' => 'title'
),
),
),
'definition' => array(
'class' => array(
'MovieApp\AbstractLister' => array(
'parameters' => array(
'criteria' => array('required' => true),
),
),
),
),
));
it will work.
from zendframework.
I am inclined to close this.
from zendframework.
Related Issues (20)
- Class Methods Hydrator - data not properly populated if object gets bound to form HOT 1
- Db/Sql/Predicate/Expression changes in #6849 introduced a BC break HOT 1
- SMTP SSL Error HOT 1
- Failed loading /home/zaman/Documents/ZendStudio/plugins/com.zend.php.executables.linux_7.1.3.201703171134/resources/ext/./ext/ZendDebugger.so: /home/zaman/Documents/ZendStudio/plugins/com.zend.php.executables.linux_7.1.3.201703171134/resources/ext/./ext/ZendDebugger.so: cannot open shared object file: No such file or directory HOT 1
- PHP-function each() has been deprecated (ZF2)
- A plugin by the name "getServiceLocator" was not found in the plugin manager Zend\Mvc\Controller\PluginManager HOT 5
- This regex may stuck in matching HOT 2
- ZF3 and Apigility 1.5 HOT 1
- Error Handling for a Specific Module Only
- Phone number validation criteria HOT 2
- Session timeout even when user is active HOT 6
- I have changed my files according to issue 5997 but still getting error No translator provided HOT 1
- Function mcrypt_*() is deprecated in Zend/Crypt/Symmetric/Mcrypt.php (ZF2) PHP 7.2 HOT 1
- Why zendframework so tricky? HOT 1
- Use of a broken or else risky cryptographic algorithm md5() in Subscriber.php at line 788 HOT 1
- Question: Advanced Routing HOT 4
- PHP 7.3 compatibility issues for zend-stdlib : Warning: "continue" targeting switch is equivalent to "break". HOT 2
- Strange ZF3 class not found error HOT 3
- CONTRIBUTING.md is not available HOT 1
- Hello , i have an error and need help 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 zendframework.