public function get($serviceName) {
        $container = $this->serviceData[$serviceName] ?? NULL;
        if($container) {
            return $container->getInstance();
        }

        if(in_array($serviceName, $this->getSelfReferenceNames()))
            return $this;

        $e = new UnknownServiceException("Service $serviceName is not registered", E_USER_ERROR);
        $e->setServiceName($serviceName);
        throw $e;
    }
public function get($serviceName) {
        $container = $this->serviceData[$serviceName] ?? NULL;
        if($container) {
            return $container->getInstance();
        }

        if(in_array($serviceName, $this->getSelfReferenceNames()))
            return $this;

        $e = new UnknownServiceException("Service $serviceName is not registered", E_USER_ERROR);
        $e->setServiceName($serviceName);
        throw $e;
    }
public function get ( $ serviceName ) { $ container = $ this -> serviceData [ $ serviceName ] ?? NULL ; if ( $ container ) { return $ container -> getInstance ( ) ; } if ( in_array ( $ serviceName , $ this -> getSelfReferenceNames ( ) ) ) return $ this ; $ e = new UnknownServiceException ( "Service $serviceName is not registered" , E_USER_ERROR ) ; $ e -> setServiceName ( $ serviceName ) ; throw $ e ; }
Returns the instance of a requested service
This method call fails if the service does not exist or something else went wrong during creating the service instance.

@param string $serviceName
@return object|null
@throws UnknownServiceException
Returns the instance of a requested service This method call fails if the service does not exist or something else went wrong during creating the service instance .