public function get($serviceType, $refInstance = null)
    {
        if (!isset($this->services[$serviceType::getName()])) {
            if (is_null($refInstance)) {
                $this->services[$serviceType::getName()] = new $serviceType();
            } else {
                $this->services[$serviceType::getName()] = new $serviceType($refInstance);
            }
        }
        return $this->services[$serviceType::getName()];
    }
public function get($serviceType, $refInstance = null)
    {
        if (!isset($this->services[$serviceType::getName()])) {
            if (is_null($refInstance)) {
                $this->services[$serviceType::getName()] = new $serviceType();
            } else {
                $this->services[$serviceType::getName()] = new $serviceType($refInstance);
            }
        }
        return $this->services[$serviceType::getName()];
    }
public function get ( $ serviceType , $ refInstance = null ) { if ( ! isset ( $ this -> services [ $ serviceType :: getName ( ) ] ) ) { if ( is_null ( $ refInstance ) ) { $ this -> services [ $ serviceType :: getName ( ) ] = new $ serviceType ( ) ; } else { $ this -> services [ $ serviceType :: getName ( ) ] = new $ serviceType ( $ refInstance ) ; } } return $ this -> services [ $ serviceType :: getName ( ) ] ; }
Returns or creates the given service type instance with optional
refInstance injection on ctor

@param string $serviceType The service classname to instantiate
@param string $refInstance The optional refInstance class to inject on ctor

@return object The requested service
@Synchronized
Returns or creates the given service type instance with optional refInstance injection on ctor