public function purge($namespace)
    {
        $this->purgeRuntimeCache();

        $directory = $this->getDirectoryByNamespace($namespace);

        // delete entries and retrieve count
        $removedEntries = $this->removeEntries($directory);

        // remove namespace from array
        unset($this->directoriesByNamespace[$namespace]);

        // clear PHP's file cache
        $this->clear();

        // return the count of entries
        return $removedEntries;
    }