src/Factory.php
private static function getService(string $sServiceType, string $sServiceName, ?string $sComponentName = '')
    {
        $sComponentName = empty($sComponentName) ? 'nails/common' : $sComponentName;

        if (!array_key_exists($sComponentName, self::$aContainers)) {
            throw new FactoryException(
                'No containers registered for ' . $sComponentName
            );
        } elseif (!array_key_exists($sServiceType, self::$aContainers[$sComponentName])) {
            throw new FactoryException(
                'No ' . $sServiceType . ' containers registered for ' . $sComponentName
            );
        } elseif (!self::$aContainers[$sComponentName][$sServiceType]->offsetExists($sServiceName)) {
            throw new FactoryException(
                ucfirst($sServiceType) . '::' . $sServiceName . ' is not provided by ' . $sComponentName
            );
        }

        return self::$aContainers[$sComponentName][$sServiceType][$sServiceName];
    }
private static function getService(string $sServiceType, string $sServiceName, ?string $sComponentName = '')
    {
        $sComponentName = empty($sComponentName) ? 'nails/common' : $sComponentName;

        if (!array_key_exists($sComponentName, self::$aContainers)) {
            throw new FactoryException(
                'No containers registered for ' . $sComponentName
            );
        } elseif (!array_key_exists($sServiceType, self::$aContainers[$sComponentName])) {
            throw new FactoryException(
                'No ' . $sServiceType . ' containers registered for ' . $sComponentName
            );
        } elseif (!self::$aContainers[$sComponentName][$sServiceType]->offsetExists($sServiceName)) {
            throw new FactoryException(
                ucfirst($sServiceType) . '::' . $sServiceName . ' is not provided by ' . $sComponentName
            );
        }

        return self::$aContainers[$sComponentName][$sServiceType][$sServiceName];
    }
private static function getService ( string $ sServiceType , string $ sServiceName , ? string $ sComponentName = '' ) { $ sComponentName = empty ( $ sComponentName ) ? 'nails/common' : $ sComponentName ; if ( ! array_key_exists ( $ sComponentName , self :: $ aContainers ) ) { throw new FactoryException ( 'No containers registered for ' . $ sComponentName ) ; } elseif ( ! array_key_exists ( $ sServiceType , self :: $ aContainers [ $ sComponentName ] ) ) { throw new FactoryException ( 'No ' . $ sServiceType . ' containers registered for ' . $ sComponentName ) ; } elseif ( ! self :: $ aContainers [ $ sComponentName ] [ $ sServiceType ] -> offsetExists ( $ sServiceName ) ) { throw new FactoryException ( ucfirst ( $ sServiceType ) . '::' . $ sServiceName . ' is not provided by ' . $ sComponentName ) ; } return self :: $ aContainers [ $ sComponentName ] [ $ sServiceType ] [ $ sServiceName ] ; }
Returns a service from the namespaced container

@param string $sServiceType   The type of the service to return
@param string $sServiceName   The name of the service to return
@param string $sComponentName The name of the module which defined it

@throws FactoryException
@return mixed
Returns a service from the namespaced container