src/Factory.php
public static function destroy(object $oInstance): bool
    {
        foreach (static::$aLoadedItems['SERVICES'] as $sKey => $oItem) {
            if ($oItem === $oInstance) {
                return static::destroyServiceOrModel(static::$aLoadedItems['SERVICES'], $sKey);
            }
        }

        foreach (static::$aLoadedItems['MODELS'] as $sKey => $oItem) {
            if ($oItem === $oInstance) {
                return static::destroyServiceOrModel(static::$aLoadedItems['MODELS'], $sKey);
            }
        }

        return false;
    }
public static function destroy(object $oInstance): bool
    {
        foreach (static::$aLoadedItems['SERVICES'] as $sKey => $oItem) {
            if ($oItem === $oInstance) {
                return static::destroyServiceOrModel(static::$aLoadedItems['SERVICES'], $sKey);
            }
        }

        foreach (static::$aLoadedItems['MODELS'] as $sKey => $oItem) {
            if ($oItem === $oInstance) {
                return static::destroyServiceOrModel(static::$aLoadedItems['MODELS'], $sKey);
            }
        }

        return false;
    }
public static function destroy ( object $ oInstance ) : bool { foreach ( static :: $ aLoadedItems [ 'SERVICES' ] as $ sKey => $ oItem ) { if ( $ oItem === $ oInstance ) { return static :: destroyServiceOrModel ( static :: $ aLoadedItems [ 'SERVICES' ] , $ sKey ) ; } } foreach ( static :: $ aLoadedItems [ 'MODELS' ] as $ sKey => $ oItem ) { if ( $ oItem === $ oInstance ) { return static :: destroyServiceOrModel ( static :: $ aLoadedItems [ 'MODELS' ] , $ sKey ) ; } } return false ; }
Destroys an object by its instance

@param object $oInstance The instance to destroy

@return bool
Destroys an object by its instance