Coder Social home page Coder Social logo

Comments (7)

zfbot avatar zfbot commented on June 12, 2024

(Originally posted by: EvanDotPro on 03/07/12)

Confirmed this works with setter injection but not constructor injection as of dd359a2.

from zendframework.

zfbot avatar zfbot commented on June 12, 2024

(Originally posted by: maks3w on 08/28/12)

Still happening

from zendframework.

zfbot avatar zfbot commented on June 12, 2024

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.

ThaDafinser avatar ThaDafinser commented on June 12, 2024

@drdev or @Maks3w does is this still a valid bug?

from zendframework.

adamlundrigan avatar adamlundrigan commented on June 12, 2024

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.

ralphschindler avatar ralphschindler commented on June 12, 2024

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.

ralphschindler avatar ralphschindler commented on June 12, 2024

I am inclined to close this.

from zendframework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.