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

method "isNotInFactoryInstancePool" and "addToFactoryInstancePool" are not created if configuration is set to "'is_factory' => false," #3

Closed
stevleibelt opened this issue May 27, 2015 · 1 comment

Comments

Projects
None yet
1 participant
@stevleibelt
Copy link
Member

commented May 27, 2015

    'instances' => array(
        array(
            //...
            'is_factory'    => false,
            'is_shared'     => true,

Configuration above will generate locator method like:

    final protected function fetchFromSharedInstancePool($className)
    {
        if ($this->isNotInFactoryInstancePool($className)) {
            if (!class_exists($className)) {
                throw new InvalidArgumentException(
                    'class "' . $className . '" does not exist'
                );
            }

            $instance = new $className();
            $this->addToFactoryInstancePool($className, $instance);
        }

        return $this->getFromSharedInstancePool($className);
    }

'addToSharedInstancePool' and 'isNotInSharedInstancePool' should be used.

@stevleibelt stevleibelt added the bug label May 27, 2015

@stevleibelt stevleibelt modified the milestones: 1.4.3, 1.5.0 May 27, 2015

@stevleibelt

This comment has been minimized.

Copy link
Member Author

commented May 27, 2015

Fixed with version 1.5.0 and above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.