src/main/php/ioc/binding/MultiBinding.php
protected function getProviderCreator($provider)
    {
        if (is_string($provider)) {
            return function($injector, $name, $key) use($provider)
                   {
                       $providerInstance = $injector->getInstance($provider);
                       if (!($providerInstance instanceof InjectionProvider)) {
                           throw new BindingException('Configured provider class ' . $provider . ' for ' . $name . '[' . $key . '] is not an instance of stubbles\ioc\InjectionProvider.');
                       }

                       return $providerInstance->get();

                   };
        } elseif ($provider instanceof InjectionProvider) {
            return function() use($provider) { return $provider->get(); };
        }

        throw new \InvalidArgumentException(
                'Given provider must either be a instance of'
                . ' stubbles\ioc\InjectionProvider or a class name representing'
                . ' such a provider instance.'
        );
    }
protected function getProviderCreator($provider)
    {
        if (is_string($provider)) {
            return function($injector, $name, $key) use($provider)
                   {
                       $providerInstance = $injector->getInstance($provider);
                       if (!($providerInstance instanceof InjectionProvider)) {
                           throw new BindingException('Configured provider class ' . $provider . ' for ' . $name . '[' . $key . '] is not an instance of stubbles\ioc\InjectionProvider.');
                       }

                       return $providerInstance->get();

                   };
        } elseif ($provider instanceof InjectionProvider) {
            return function() use($provider) { return $provider->get(); };
        }

        throw new \InvalidArgumentException(
                'Given provider must either be a instance of'
                . ' stubbles\ioc\InjectionProvider or a class name representing'
                . ' such a provider instance.'
        );
    }
creates a closure which uses the given provider to create the value

@param   string|\stubbles\ioc\InjectionProvider  $provider
@return  \Closure
@throws  \InvalidArgumentException