@param string $class

@return string
163140
public function getSampleDirectory($class)
    {
        $serializer = $this->get($class);

        if (method_exists($serializer, 'getSamples')) {
            $url = $serializer->getSamples();
            $path = explode('/', $url);

            return $this->rootDir.'/vendor/claroline/distribution/'
              .$path[1].'/'.$path[2].'/Resources/samples/'.$path[3];
        }
    }
634424
public static function getNamespace($class)
    {
        if (is_object($class) === true) {
            $class = get_class($class);
        }
        foreach (['\\', '_'] as $separator) {
            $pos = strrpos($class, $separator);
            if ($pos !== false) {
                return ltrim(substr($class, 0, $pos), $separator);
            }
        }
        return '';
    }
84458
public function getChildOfClass($class)
    {
        // Check for namespace alias
        if (strpos($class, ':') !== false) {
            list($namespaceAlias, $simpleClassName) = explode(':', $class);
            $class = $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName;
        }
        foreach ($this->getChildren() as $child) {
            if ($child->getPage() instanceof $class) {
                return $child;
            }
        }

        return null;
    }
1307394
public static function getClassDescription(string $class, string &$resolvedClass = null): string
    {
        $resolvedClass = $class;
        try {
            $resource = new ClassExistenceResource($class, false);

            // isFresh() will explode ONLY if a parent class/trait does not exist
            $resource->isFresh(0);

            $r = new \ReflectionClass($class);
            $resolvedClass = $r->name;

            if ($docComment = $r->getDocComment()) {
                $docComment = preg_split('#\n\s*\*\s*[\n@]#', substr($docComment, 3, -2), 2)[0];

                return trim(preg_replace('#\s*\n\s*\*\s*#', ' ', $docComment));
            }
        } catch (\ReflectionException $e) {
        }

        return '';
    }
614734
private function getMetadata($class)
    {
        $class = ClassUtils::getRealClass(ltrim($class, '\\'));

        if (!array_key_exists($class, $this->metadataCache)) {
            $this->metadataCache[$class] = null;

            if (null !== $manager = $this->registry->getManagerForClass($class)) {
                $this->metadataCache[$class] = $manager->getClassMetadata($class);
            }
        }

        return $this->metadataCache[$class];
    }
214960
public function findFile($class)
    {
        if (false === $file = apc_fetch($this->prefix.$class)) {
            apc_store($this->prefix.$class, $file = $this->decorated->findFile($class));
        }

        return $file;
    }
1115378
private function getService($class)
    {
        if (!array_key_exists($class, $this->services)) {
            $this->services[$class] = new $class($this->getClient(), $this->getLogger());
        }

        return $this->services[$class];
    }
130361
public function resolveClass( $class )
	{
		if ( !is_string( $class ) )
			throw new ResolverException( "Class must be a string" );

		// Check if a class has been mapped to a key
		if ( array_key_exists( $class, $this->classAlias ) )
			try
			{
				return $this->resolve( null, $this->classAlias[$class] );
			}
			catch ( ResolverException $e )
			{
				// Ignore
			}

		// Check if the class has been initialized
		foreach ( $this->instances as $instance )
			if ( get_class( $instance ) == $class )
				return $instance;

		// TODO Other methods to check?

		return false;
	}
898882
public function resolve($class)
    {
        $result = false;
        $prefix = $class;

        while (false !== ($pos = strrpos($prefix, '\\'))) {
            $prefix = substr($class, 0, $pos + 1);

            if (isset($this->prefixes[$prefix])) {
                $result = $this->resolveFilename($prefix, str_replace('\\', '/', substr($class, $pos + 1)));

                if ($result !== false) {
                    break;
                }
            }

            $prefix = rtrim($prefix, '\\');
        }

        return $result;
    }
1074658
private function getClassMethods($class)
    {
        $result = '';

        foreach($class->getMethods(\ReflectionMethod::IS_PUBLIC) as $method)
        {
            $args = [];
            $comments = [];
            foreach($method->getParameters() as $param)
            {
                // 方法参数定义
                $args[] = $this->getMethodParamDefine($param);
                $comments[] = '@var ' . ($param->getType() ?? 'mixed') . ' $' . $param->name;
            }
            $return = $method->getReturnType();
            if(null !== $return)
            {
                $comments[] = '@return ' . $return;
            }
            $args = implode(', ', $args);
            if([] === $comments)
            {
                $comment = '';
            }
            else
            {
                $comment = implode(PHP_EOL . '     * ', $comments);
                $comment = <<<COMMENT

    /**
     * {$comment}
     */
COMMENT;
            }
            if($method->isStatic())
            {
                $static = ' static';
            }
            else
            {
                $static = '';
            }
            $result .= <<<CODE
{$comment}
    public{$static} function {$method->name}({$args}){}

CODE;
        }

        return $result;
    }
1252238
protected function getValidAlgorithm($class)
    {
        $logging = \Plop\Plop::getInstance();;
        $w =    'abcdefghijklmnopqrstuvwxyz' .
                'ABCDEFGHIJKLMNOPQRSTUVWXYZ' .
                '1234567890-@.';
        $name = $class::getName();
        if (!is_string($name) || strspn($name, $w) !== strlen($name)) {
            $logging->debug(
                'Skipping algorithm "%(name)s" (invalid algorithm name)',
                array('name' => $name)
            );
            return null;
        }
        return $name;
    }
634220
public function loadClass($class)
    {
        $result = $this->loadCachedClass($class);

        if ($result === false) {
            $result = parent::loadClass($class);
        }

        if ($this->verbose) {
            return $result !== false;
        }
    }
962888
public function get($class)
    {
        $class = ltrim($class, '\\');

        if (!isset($this->sharedInstances[$class])) {
            $this->sharedInstances[$class] = $this->create($class);
        }
        return $this->sharedInstances[$class];
    }
363289
private function buildAlias($class)
    {
        $parts     = explode('\\', $class);
        $shortName = end($parts);

        if (false === strpos($shortName, 'Validator')) {
            return Inflector::tableize($shortName);
        }

        if ('Validator' !== substr($shortName, -9)) {
            return Inflector::tableize($shortName);
        }

        return Inflector::tableize(substr($shortName, 0, -9));
    }
549148
public function findFile($class)
    {
        $class = Normalizer::ns($class, false);
        if (isset($this->classMap[$class])) {
            return $this->classMap[$class];
        }
        $index = substr($class, 0, 4);
        if (isset($this->indexes[$index])) {
            $namespace = $class;
            while (false !== $pos = strrpos($namespace, '\\')) {
                $namespace = substr($class, 0, $pos + 1);
                if (! isset($this->paths[$namespace])) {
                    $namespace = rtrim($namespace, '\\');
                    continue;
                }
                $subclass = substr($class, $pos + 1);
                $subpath  = Normalizer::path($subclass, false) . '.php';
                foreach ($this->paths[$namespace] as $dir) {
                    $path = $dir . $subpath;
                    if (is_readable($path)) {
                        if ($this->classRegistration) {
                            $this->classMap[$class] = $path;
                        }

                        return $path;
                    }
                }
                $namespace = rtrim($namespace, '\\');
            }
        }

        if ($this->classRegistration) {
            $this->classMap[$class] = false;
        }

        return false;
    }
1222792
public static function getRealType($class) {
        $callback = function () use ($class) {
            $instance = new \ReflectionClass($class);
            $doc = $instance->getDocComment();
            unset($instance);
            preg_match_all('/\@property\s+([a-z]+)\s+\$([a-z\d_]+)/i', $doc, $matches, PREG_SET_ORDER);
            return array_column($matches, 1, 2);
        };
        if (app()->isDebug()) {
            return $callback();
        }
        return cache()->getOrSet('class_doc_type:'.$class, $callback, 86400);
    }
676745
protected function getUrlPattern($class = null)
    {
        $url       = '';
        $classname = is_null($class) ? $this->model->owner_type : $class;
        if (!class_exists($classname)) {
            return $url;
        }
        if ($this->hasMethod($classname, 'getPatternUrl')) {
            $url = $classname::getPatternUrl($this->model->owner_id, $this->model);
        }
        return $url;
    }