src/Core/Injector/Injector.php
public function unregisterObjects($types)
    {
        if (!is_array($types)) {
            $types = [ $types ];
        }

        // Filter all objects
        foreach ($this->serviceCache as $key => $object) {
            foreach ($types as $filterClass) {
                // Prevent destructive flushing
                if (strcasecmp($filterClass, 'object') === 0) {
                    throw new InvalidArgumentException("Global unregistration is not allowed");
                }
                if ($object instanceof $filterClass) {
                    $this->unregisterNamedObject($key);
                    break;
                }
            }
        }
        return $this;
    }
public function unregisterObjects($types)
    {
        if (!is_array($types)) {
            $types = [ $types ];
        }

        // Filter all objects
        foreach ($this->serviceCache as $key => $object) {
            foreach ($types as $filterClass) {
                // Prevent destructive flushing
                if (strcasecmp($filterClass, 'object') === 0) {
                    throw new InvalidArgumentException("Global unregistration is not allowed");
                }
                if ($object instanceof $filterClass) {
                    $this->unregisterNamedObject($key);
                    break;
                }
            }
        }
        return $this;
    }
public function unregisterObjects ( $ types ) { if ( ! is_array ( $ types ) ) { $ types = [ $ types ] ; } // Filter all objects foreach ( $ this -> serviceCache as $ key => $ object ) { foreach ( $ types as $ filterClass ) { // Prevent destructive flushing if ( strcasecmp ( $ filterClass , 'object' ) === 0 ) { throw new InvalidArgumentException ( "Global unregistration is not allowed" ) ; } if ( $ object instanceof $ filterClass ) { $ this -> unregisterNamedObject ( $ key ) ; break ; } } } return $ this ; }
Clear out objects of one or more types that are managed by the injetor.

@param array|string $types Base class of object (not service name) to remove
@return $this
Clear out objects of one or more types that are managed by the injetor .