Puli\Repository\InMemoryRepository::removeResource PHP Method

removeResource() private method

private removeResource ( Puli\Repository\Api\Resource\PuliResource $resource )
$resource Puli\Repository\Api\Resource\PuliResource
    private function removeResource(PuliResource $resource)
    {
        $path = $resource->getPath();
        $this->removeVersions($path);
        // Ignore non-existing resources
        if (!isset($this->resources[$path])) {
            return;
        }
        // Recursively remove directory contents
        foreach ($this->getChildIterator($resource) as $child) {
            $this->removeResource($child);
        }
        unset($this->resources[$path]);
        // Detach from locator
        $resource->detach();
    }