public function clear()
    {
        $cleared = [];
        if (false === $this->mf->hasCache()) {
            return $cleared;
        }

        $this->mf->enableCache(false);
        foreach ($this->mf->getAllTypeNames() as $type) {
            $metadata = $this->mf->getMetadataForType($type);
            $this->mf->getCache()->evictMetadataFromCache($metadata);
            $cleared[] = $type;
        }
        $this->mf->enableCache(true);
        $this->mf->clearMemory();
        return $cleared;
    }