src/main/php/ioc/binding/SessionBindingScope.php
public function getInstance(\ReflectionClass $impl, InjectionProvider $provider)
    {
        if (null === $this->session) {
            throw new \RuntimeException('Can not create session-scoped instance for ' . $impl->getName() . ', no session set in session scope');
        }

        $key = self::SESSION_KEY . $impl->getName();
        if ($this->session->hasValue($key)) {
            return $this->session->value($key);
        }

        $instance = $provider->get();
        $this->session->putValue($key, $instance);
        return $instance;
    }
public function getInstance(\ReflectionClass $impl, InjectionProvider $provider)
    {
        if (null === $this->session) {
            throw new \RuntimeException('Can not create session-scoped instance for ' . $impl->getName() . ', no session set in session scope');
        }

        $key = self::SESSION_KEY . $impl->getName();
        if ($this->session->hasValue($key)) {
            return $this->session->value($key);
        }

        $instance = $provider->get();
        $this->session->putValue($key, $instance);
        return $instance;
    }
public function getInstance ( \ ReflectionClass $ impl , InjectionProvider $ provider ) { if ( null === $ this -> session ) { throw new \ RuntimeException ( 'Can not create session-scoped instance for ' . $ impl -> getName ( ) . ', no session set in session scope' ) ; } $ key = self :: SESSION_KEY . $ impl -> getName ( ) ; if ( $ this -> session -> hasValue ( $ key ) ) { return $ this -> session -> value ( $ key ) ; } $ instance = $ provider -> get ( ) ; $ this -> session -> putValue ( $ key , $ instance ) ; return $ instance ; }
returns the requested instance from the scope

@param   \ReflectionClass                 $impl      concrete implementation
@param   \stubbles\ioc\InjectionProvider  $provider
@return  object
@throws  \RuntimeException
returns the requested instance from the scope