@param \ReflectionClass $reflection

@return mixed|string
433285
public function parseTableName(\ReflectionClass $reflection)
    {
        $hd = $this->parser->parse($reflection->getDocComment());

        if (!empty($hd[0])) {
            return $hd[1];
        }

        $table = substr($reflection->getName(), strlen($reflection->getNamespaceName()));

        return strtolower(str_replace('\\', '', $table));
    }
1318867
private static function createCallmapProxyCode(\ReflectionClass $class): string
    {
        if ($class->isFinal()) {
            throw new \InvalidArgumentException(
                    'Can not create mapping proxy for final class '
                    . $class->getName()
            );
        }

        $code = self::createClassDefinition($class)
                . self::createMethods($class)
                . "}\n";
        if ($class->inNamespace()) {
            return sprintf(
                    "namespace %s {\n%s}\n",
                    $class->getNamespaceName(),
                    $code
            );
        }

        return $code;
    }
1222342
public function getDependencies(\ReflectionClass $reflected)
    {
        $dependencies = [];

        if ($constructor = $reflected->getConstructor()) {
            $parameters = $constructor->getParameters();
            foreach ($parameters as $parameter) {
                $dependencies[] = $this->getDependency($parameter, $reflected);
            }
        }

        return $dependencies;
    }
387021
private static function getFunctionName(\ReflectionFunctionAbstract $reflection) : string
    {
        $name = $reflection->name.'()';

        if ($reflection instanceof \ReflectionMethod) {
            $name = $reflection->getDeclaringClass()->name.'::'.$name;
        }

        return $name;
    }
795657
private function loadTranslatableMetadata(\ReflectionClass $class) {
        $classMetadata = new TranslatableMetadata($class->name);

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

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

            if ($this->reader->getPropertyAnnotation($property, 'Prezent\\Doctrine\\Translatable\\Annotation\\CurrentLocale')) {
                $classMetadata->currentLocale = $propertyMetadata;
                $classMetadata->addPropertyMetadata($propertyMetadata);
            }
            
            if ($this->reader->getPropertyAnnotation($property, 'Prezent\\Doctrine\\Translatable\\Annotation\\FallbackLocale')) {
                $classMetadata->fallbackLocale = $propertyMetadata;
                $classMetadata->addPropertyMetadata($propertyMetadata);
            }
            
            if ($annot = $this->reader->getPropertyAnnotation($property, 'Prezent\\Doctrine\\Translatable\\Annotation\\Translations')) {
                $classMetadata->targetEntity = $annot->targetEntity;
                $classMetadata->translations = $propertyMetadata;
                $classMetadata->addPropertyMetadata($propertyMetadata);
            }
        }

        return $classMetadata;
    }
547241
protected function getPropertiesMeta(ReflectionClass $reflection): array
    {
        $meta = [];
        $defaults = $reflection->getDefaultProperties();
        $properties = $reflection->getProperties(ReflectionProperty::IS_PUBLIC);

        foreach ($properties as $item) {
            $name = $item->getName();
            $meta[$name] = [
                'name' => $name,
                'title' => uncase($name)
            ];

            if (array_key_exists($name, $defaults)) {
                $meta[$name]['default'] = $defaults[$name];
            }
        }

        return $meta;
    }
481403
private function getPropertyValue(ReflectionClass $reflection, $property, $object)
    {
        $propertyReflection = $this->accessProperty($reflection, $property);
        $value = $propertyReflection->getValue($object);
        $propertyReflection->setAccessible(false);

        return $value;
    }
287750
public function parseClass(\ReflectionClass $class)
    {
        if (false === $filename = $class->getFilename()) {
            return array();
        }

        $content = $this->getFileContent($filename, $class->getStartLine());
        $namespace = str_replace('\\', '\\\\', $class->getNamespaceName());
        $content = preg_replace('/^.*?(\bnamespace\s+' . $namespace . '\s*[;{].*)$/s', '\\1', $content);
        $this->tokens = token_get_all('<?php ' . $content);
        $this->numTokens = count($this->tokens);
        $this->pointer = 0;

        $statements = $this->parseUseStatements($class->getNamespaceName());

        return $statements;
    }
455885
protected function get_class_name( $object ): string {

		if ( is_a( $object, 'CLosure' ) ) {
			$class = new \ReflectionFunction( $object );

			return 'closure from ' . $this->shorten_path( $class->getFileName() ) . ':' . $class->getStartLine();
		}

		$class = new \ReflectionClass( $object );
		$name  = $class->getName();

		if ( 0 === strpos( $name, 'class@anonymous' ) ) {
			return 'anonymous class from ' . $this->shorten_path( $class->getFileName() ) . ':' . $class->getStartLine();
		}

		return $name;
	}
944588
public function findFileForClass(\ReflectionClass $class, $extension)
    {
        foreach ($this->dirs as $prefix => $dir) {
            if ('' !== $prefix && 0 !== strpos($class->getNamespaceName(), $prefix)) {
                continue;
            }

            $len = '' === $prefix ? 0 : strlen($prefix) + 1;
            $path = $dir . '/' . str_replace('\\', '.', substr($class->name, $len)) . '.' . $extension;

            if ($this->repository->contains($path)) {
                return $this->repository->get($path)->getFilesystemPath();
            }
        }

        return null;
    }
107603
protected function getPropertiesMeta(ReflectionClass $reflection): array
    {
        $meta = [];
        $properties = $reflection->getProperties(ReflectionProperty::IS_PUBLIC);

        foreach ($properties as $item) {
            $doc = $item->getDocComment();
            $notations = $this->parser->parse($doc);

            if (count($notations) > 0) {
                $meta[$item->getName()] = $notations;
            }
        }

        return $meta;
    }
283508
private function getClassMetadata(\ReflectionClass $reflectionClass)
    {
        /** @var ClassMetadata $classMetadata */
        $classMetadata = $this->getMetadataDriver()->loadMetadataForClass($reflectionClass);
        if (null === $classMetadata->encryptionMode) {
            $classMetadata->encryptionMode = $this->settings['default_mode'];
        }
        return $classMetadata;
    }
887427
final protected function _getPropertyKey(\ReflectionProperty $property)
	{
		$static = $property->isStatic() ? ' static' : '';
		if ($property->isPublic()) {
			return 'public' . $static . ' ' . $property->getName();
		}
		if ($property->isProtected()) {
			return 'protected' . $static . ' ' . $property->getName();
		}
		if ($property->isPrivate()) {
			return 'private' . $static . ' ' . $property->getName();
		}
	}
448833
public function loadMetadataForClass(\ReflectionClass $class)
    {
        $classMetadata = new ClassMetadata($class->name);
        $classMetadata->fileResources[] = $class->getFileName();

        foreach ($this->reader->getClassAnnotations($class) as $annotation) {
            if ($annotation instanceof NamespaceNode) {
                $classMetadata->addGraphNamespace($annotation);
            }

            if ($annotation instanceof GraphNode) {
                $classMetadata->addGraphMetadata($annotation, new MetadataValue($annotation->value));
            }
        }

        foreach ($class->getProperties() as $property) {
            foreach ($this->reader->getPropertyAnnotations($property) as $annotation) {
                if ($annotation instanceof GraphNode) {
                    $classMetadata->addGraphMetadata($annotation, new PropertyMetadata($class->name, $property->name));
                }
            }
        }

        foreach ($class->getMethods() as $method) {
            foreach ($this->reader->getMethodAnnotations($method) as $annotation) {
                if ($annotation instanceof GraphNode) {
                    $classMetadata->addGraphMetadata($annotation, new MethodMetadata($class->name, $method->name));
                }
            }
        }

        return $classMetadata;
    }
341860
protected function getReturnTypeFromDocBlock(\ReflectionMethod $reflection)
    {
        $type = null;
        $phpdoc = new DocBlock($reflection);

        if ($phpdoc->hasTag('return')) {
            $type = $phpdoc->getTagsByName('return')[0]->getType();
        }

        return $type;
    }
1141870
public static function get($class)
    {
        $key = strtolower($class);

        if (isset(static::$instances[$key])) {
            return static::$instances[$key];
        }

        static::override($class);

        if (!class_exists($class)) {
            throw new ReflectionException("Class $class does not exist");
        }

        $instance = static::getInstance($class);
        static::register($class, $instance);
        return $instance;
    }
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;
    }