src/main/php/ioc/binding/ConstantBinding.php
public function getInstance(Injector $injector, $name)
    {
        if (null !== $this->provider) {
            return $this->provider->get($name);
        }

        if (null != $this->providerClass) {
            $provider = $injector->getInstance($this->providerClass);
            if (!($provider instanceof InjectionProvider)) {
                 throw new BindingException('Configured provider class ' . $this->providerClass . ' for constant ' . $this->name . ' is not an instance of stubbles\ioc\InjectionProvider.');
            }

            $this->provider = $provider;
            return $this->provider->get($name);
        }

        return $this->value;
    }
public function getInstance(Injector $injector, $name)
    {
        if (null !== $this->provider) {
            return $this->provider->get($name);
        }

        if (null != $this->providerClass) {
            $provider = $injector->getInstance($this->providerClass);
            if (!($provider instanceof InjectionProvider)) {
                 throw new BindingException('Configured provider class ' . $this->providerClass . ' for constant ' . $this->name . ' is not an instance of stubbles\ioc\InjectionProvider.');
            }

            $this->provider = $provider;
            return $this->provider->get($name);
        }

        return $this->value;
    }
public function getInstance ( Injector $ injector , $ name ) { if ( null !== $ this -> provider ) { return $ this -> provider -> get ( $ name ) ; } if ( null != $ this -> providerClass ) { $ provider = $ injector -> getInstance ( $ this -> providerClass ) ; if ( ! ( $ provider instanceof InjectionProvider ) ) { throw new BindingException ( 'Configured provider class ' . $ this -> providerClass . ' for constant ' . $ this -> name . ' is not an instance of stubbles\ioc\InjectionProvider.' ) ; } $ this -> provider = $ provider ; return $ this -> provider -> get ( $ name ) ; } return $ this -> value ; }
returns the created instance

@param   \stubbles\ioc\Injector  $injector
@param   string                  $name
@return  mixed
returns the created instance