@param $class

@return Metadata
@throws NotFoundException
331675
public function getMetadataFor($class)
    {
        if (isset($this->metadata[$class])) {
            
            $identity = new ObjectIdentity(sprintf('%s@%s', Metadata::class, $class));
            if (!$this->getClassManager()->hasShared($identity->getIdentifier())) {
                /**
                 * @var MetadataInterface $metadata
                 */
                $metadata = $this->getClassManager()->createInstanceFor(Metadata::class, ...[$this->metadata[$class]]);
                $dispatcher = $this->getServiceLocator()->getDispatcher();
                
                $dispatcher->dispatch(ORMEvents::onMetadataLoad, new MetadataLoadEvent($metadata));
                
                $this->getClassManager()->setShared($identity->getIdentifier(), $metadata);
            }
            
            return $this->getClassManager()->getShared($identity->getIdentifier());
        }
        
        throw new NotFoundException('Metadata for ":class" not found', ['class' => $class]);
    }
1180499
public function whenCreating($class)
    {
        if (!isset($this->args[$class])) {
            $this->args[$class] = new ClassMeta($class, $this);
        }

        return $this->args[$class];
    }
253839
public static function getClass($class) {
        $cache = null;

        if (is_object($class)) {
            $cache = new Cache('gcs_cache_annotation_' . strtolower(str_replace('\\', '-', get_class($class))), 0);
        }
        else {
            $cache = new Cache('gcs_cache_annotation_' . strtolower(str_replace('\\', '-', $class)), 0);
        }

        if ($cache->isExist() && Config::config()['user']['debug']['environment'] != 'development') {
            return $cache->getCache();
        }

        $data = ['class' => [], 'methods' => [], 'properties' => []];

        $reflectionClass = new \ReflectionClass($class);

        //Class annotations
        $parser = new Parser($reflectionClass->getDocComment());
        $dataClasses = $parser->parse();

        foreach ($dataClasses as $key => $dataClass) {
            $processorClass = new Processor($dataClass);
            array_push($data['class'], [0 => ['annotation' => $dataClass['type'], 'instance' => $processorClass->process()]]);
        }

        //Method annotations
        $methodsName = $reflectionClass->getMethods();

        foreach ($methodsName as $methodName) {
            $method = new \ReflectionMethod($class, $methodName->getName());

            $parser = new Parser($method->getDocComment());
            $dataMethods = $parser->parse();

            if (count($dataMethods) > 0) {
                $data['methods'][$methodName->getName()] = [];

                foreach ($dataMethods as $key => $dataMethod) {
                    $processorMethods = new Processor($dataMethod);
                    array_push($data['methods'][$methodName->getName()], ['annotation' => $dataMethod['type'], 'instance' => $processorMethods->process()]);
                }
            }
        }

        //Properties annotations
        $propertiesNames = $reflectionClass->getProperties();

        foreach ($propertiesNames as $propertyName) {
            $property = new \ReflectionProperty($class, $propertyName->getName());

            $parser = new Parser($property->getDocComment());
            $dataProperties = $parser->parse();

            if (count($dataProperties) > 0) {
                $data['properties'][$propertyName->getName()] = [];

                foreach ($dataProperties as $key => $dataProperty) {
                    $processorProperties = new Processor($dataProperty);
                    array_push($data['properties'][$propertyName->getName()], ['annotation' => $dataProperty['type'], 'instance' => $processorProperties->process()]);
                }
            }
        }

        $cache->setContent($data);
        $cache->setCache();

        return $data;
    }
1367032
protected function getClassMetadata(string $resourceClass): ClassMetadata
    {
        return $this
            ->getManagerRegistry()
            ->getManagerForClass($resourceClass)
            ->getClassMetadata($resourceClass);
    }
265269
private function getManagerFor($class)
    {
        $manager = $this->doctrine->getManagerForClass($class);

        if ($manager === null) {
            throw new \RuntimeException(
                sprintf(
                    'Class "%s" seems not to be a managed Doctrine entity. Did you forget to map it?',
                    $class
                )
            );
        }

        return $manager;
    }
594089
private function loadTranslationMetadata(\ReflectionClass $class)
    {
        $classMetadata = new TranslationMetadata($class->name);

        foreach ($class->getProperties() as $property) {
            if ($property->class !== $class->name) {
                continue;
            }

            $propertyMetadata = new PropertyMetadata($class->name, $property->getName());

            if ($annot = $this->reader->getPropertyAnnotation($property, 'Prezent\\Doctrine\\Translatable\\Annotation\\Translatable')) {
                $classMetadata->targetEntity = $annot->targetEntity;
                $classMetadata->translatable = $propertyMetadata;
                $classMetadata->addPropertyMetadata($propertyMetadata);
            }

            if ($this->reader->getPropertyAnnotation($property, 'Prezent\\Doctrine\\Translatable\\Annotation\\Locale')) {
                $classMetadata->locale = $propertyMetadata;
                $classMetadata->addPropertyMetadata($propertyMetadata);
            }
        }

        return $classMetadata;
    }
780664
public function findFile($class)
    {
        return $this->finder->findFile($class, $this->prefixPaths, $this->basePaths, $this->useIncludePath);
    }
183399
public function findFile(string $class)
    {
        // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
        if ('\\' === $class[0]) {
            $class = (string)\substr($class, 1);
        }

        // class map lookup
        if (isset($this->classMap[$class])) {
            return $this->classMap[$class];
        }

        $file = $this->findFileWithExtension($class, '.php');

        if (false === $file) {
            // Remember that this class does not exist.
            $this->missingClasses[$class] = true;
        }

        return $file;
    }
877850
public function provider($class)
    {

        $class = ltrim($class, '\\');

        if (isset($this->providers[$class])) {
            return $this->providers[$class];
        }

        if (!isset($this->providerFactories[$class])) {
            throw new HandlerNotFoundException("No provider for class $class found.");
        }

        $this->providers[$class] = call_user_func($this->providerFactories[$class], $class);

        return $this->providers[$class];

    }
332421
public function getMetadataFor($className)
    {
        if (!isset($this->metadata[$className])) {
            $reflectionClass = ClassUtils::newReflectionClass($className);
            $this->metadata[$className] = $this->getClassMetadata($reflectionClass);
        }

        return $this->metadata[$className];
    }
181369
protected function getApi($class)
    {
        $class = "\\" . __NAMESPACE__ . "\\Api\\" . $class;

        if ( ! class_exists($class)) {
            throw new InCommonException(sprintf('%s API handler does not exist.', $class));
        }

        if ( ! array_key_exists($class, $this->apis)) {
            $this->apis[$class] = new $class($this->client);
        }

        return $this->apis[$class];
    }
599490
private function getCustomObjectMeta($entityClass)
    {
        if (!array_key_exists($entityClass, $this->customObjectMeta)) {
            $meta = $this->extendedMetadataFactory->getExtendedMetadata($entityClass);

            $this->customObjectMeta[$entityClass] = isset($meta['customObjects']) && !empty($meta['customObjects'])
                ? $meta['customObjects']
                : null;
        }

        return $this->customObjectMeta[$entityClass];
    }
924185
protected function createDefinition(string $class): Definition
    {
        $path = $this->basePath . DIRECTORY_SEPARATOR . str_replace('\\', '.', $class) . '.yml';

        if (! is_file($path)) {
            throw new DefinitionNotFoundException($class);
        }

        $config = $this->readConfig($path);
        $definition = new Definition($class);

        foreach ($this->processors as $processor)
        {
            $processor->process($config, $definition);
        }

        return $definition;
    }
904158
public function getClass(string $class){
        if(!class_exists($class)){
            throw new \InvalidArgumentException();
        }

        if(!array_key_exists($class, $this->classes)){
            $this->classes[$class]  = new \ReflectionClass($class);
        }

        return $this->classes[$class];
    }
908530
public function findFile($class)
    {
        $file = apc_fetch($this->key . $class);

        if (!$file) {
            $file = $this->loader->findFile($class);
            apc_store($this->key . $class, $file);
        }

        return $file;
    }
755978
public function loadMetadataForClass(\ReflectionClass $class)
    {
        $classMetadata = new MergeableClassMetadata($class->getName());

        foreach ($class->getProperties() as $reflectionProperty) {
            $propertyMetadata = new PropertyMetadata($class->getName(), $reflectionProperty->getName());

            /** @var $annotation \Zicht\Bundle\FileManagerBundle\Annotation\File */
            $annotation = $this->reader->getPropertyAnnotation(
                $reflectionProperty,
                'Zicht\Bundle\FileManagerBundle\Annotation\File'
            );
            if (null !== $annotation) {
                // a "@DefaultValue" annotation was found
                $propertyMetadata->fileManager = $annotation->settings;
            }

            $classMetadata->addPropertyMetadata($propertyMetadata);
        }

        return $classMetadata;
    }
175730
public function resolveClassFromCache(string $class)
    {
        if($this->cache->has($class)) {
            return $this->cache->get($class);
        }

        $resolved = $this->resolveClass($class);

        //cache class
        $this->store($class, $resolved);

        return $resolved;
    }