@param $class

@return string
@throws \InvalidArgumentException
2430
private function getFullyQualifiedName($class)
    {
        if (class_exists($class)) {
            return $class;
        }

        //determine if class belongs to the default namespace
        if (class_exists($this->defaultNamespace . '\\' . $class)) {
            return $this->defaultNamespace . '\\' . $class;
        }

        //determine if class belongs to current namespace
        if (class_exists($this->currentNamespace . '\\' . $class)) {
            return $this->currentNamespace . '\\' . $class;
        }

        //if not, check imports
        if (isset($this->imports[ $class ])) {
            //determine if class is aliased directly
            $class = $this->imports[ $class ];

        } else if (($nsDelimiter = strpos($class, '\\')) !== false) {
            //if not, determine if class is part of one of the imported namespaces
            $namespace = substr($class, 0, $nsDelimiter);
            if (!isset($this->imports[ $namespace ])) {
                throw new \InvalidArgumentException("Class {$class} is not found");
            }
            $class = $this->imports[ $namespace ] . substr($class, $nsDelimiter);
        }

        //if class still doesn't exist, throw exception
        if (!class_exists($class)) {
            throw new \InvalidArgumentException("Class {$class} is not found");
        }

        return $class;
    }
1086889
public function getProperties(string $class){
        if(!class_exists($class)){
            throw new \InvalidArgumentException();
        }

        if(!array_key_exists($class, $this->props)){
            $this->props[$class]    = $this->getClass($class)->getProperties();
        }

        return $this->props[$class];
    }
672252
protected function getPsr4ClassPath($class)
    {
        $options = $this->context->getOptions();
        $psr4    = $options->getPsr4() ?: [];
        $class   = trim($class, '\\');

        foreach ($psr4 as $item) {
            $prefix = trim($item, '\\') . '\\';
            $length = strlen($prefix);
            $start  = substr($class, 0, $length);

            if ($start !== $prefix) {
                continue;
            }

            $name = trim(str_replace($prefix, '', $class), '\\');
            $path = $this->getClassPath($name);

            return $path;
        }

        return $this->getClassPath($class);
    }
1365761
public function getModule(string $class) : Module
    {
        foreach ($this->modules as $module) {
            if ($module instanceof $class) {
                return $module;
            }
        }

        throw new \InvalidArgumentException("No register module modules with class '%s'", get_class($class));
    }
285211
private function findClasspathAndClass($class)
    {
        if (false !== $pos = strrpos($class, '\\')) {
            // namespaced class name
            $classpath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)) . DIRECTORY_SEPARATOR;
            $classname = substr($class, $pos + 1);

            return array($classpath, $classname);
        }

        // PEAR-like class name
        $classpath = null;
        $classname = $class;

        return array($classpath, $classname);
    }
928430
public static function classToName(string $class): string
    {
        $shortClassName = self::getShortClassName($class);
        $rawCommandName = Strings::substring($shortClassName, 0, -strlen('Command'));

        // ECSCommand => ecs
        for ($i = 0; $i < strlen($rawCommandName); ++$i) {
            if (ctype_upper($rawCommandName[$i]) && self::isFollowedByUpperCaseLetterOrNothing($rawCommandName, $i)) {
                $rawCommandName[$i] = strtolower($rawCommandName[$i]);
            } else {
                break;
            }
        }

        $rawCommandName = lcfirst($rawCommandName);

        return Strings::replace($rawCommandName, '#[A-Z]#', function (array $matches): string {
            return '-' . strtolower($matches[0]);
        });
    }
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;
    }
440786
protected static function get_arguments($class)
    {
        if (isset(self::$arguments[$class])) {
            return self::$arguments[$class];
        } else {
            if ($staticFields = Config::inst()->get($class, 'translatable_fields', Config::FIRST_SET)) {
                if (is_array($staticFields) && !empty($staticFields)) {
                    return $staticFields;
                }
            }
        }

        return null;
    }
1259355
final public static function getImplementation($class) {
        if (!is_a($class, __CLASS__, $allowString=true)) {
            if (!is_class($class)) throw new ClassNotFoundException('Class not found: '.$class );
            throw new InvalidArgumentException('Not a '.__CLASS__.' subclass: '.$class);
        }
        /** @var self $dao */
        $dao = self::getInstance($class);
        return $dao;
    }
677317
public static function getClassAndAlias($class)
    {
        if (false !== strpos($class, ' ')) {
            list($class, $alias) = explode(' ', $class);
        } else {
            $alias = null;
        }
        if (0 === strpos($class, '\\')) {
            $class = substr($class, 1);
        }

        return [$class, $alias];
    }
579522
private function getFromCache(string $class): ?ClassMetadataInterface
    {
        if (null === $this->cache) {
            return null;
        }

        if ($this->cache instanceof Cache) {
            $cached = $this->cache->fetch($class) ?: null;
        } else {
            $class = preg_replace('#[\{\}\(\)/\\\\@:]#', '_', str_replace('_', '__', $class));
            $item = $this->cache->getItem($class);
            $cached = $item->isHit() ? $item->get() : null;
        }

        return $cached;
    }
822349
private function metaKeyFromClassName($class)
    {
        $key = trim($class, '\\');

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

        $ident = strtolower(preg_replace('/([a-z])([A-Z])/', '$1-$2', $class));
        $ident = str_replace('\\', '/', strtolower($ident));
        $ident = ltrim($ident, '/');

        static::$snakeCache[$key]   = $ident;
        static::$camelCache[$ident] = $key;

        return $ident;
    }
1216698
public function setIteratorClass($class)
    {
        if (strpos($class, '\\') !== 0)
            $class = sprintf('%s%s', '\\', $class);

        if (class_exists($class, true))
        {
            $this->iteratorClass = $class;
            return;
        }

        throw new \InvalidArgumentException(vsprintf(
            '%s::setIteratorClass - Class "%s" is not defined.',
            array(
                get_class($this),
                $class))
        );
    }
210063
public function typeNameForDataObject($class)
    {
        $customTypeName = $this->mappedTypeName($class);
        if ($customTypeName) {
            return $customTypeName;
        }

        $parts = explode('\\', $class);
        $typeName = sizeof($parts) > 1 ? $parts[0] . end($parts) : $parts[0];

        return $this->typeName($typeName);
    }
189892
protected function buildCustomDatabaseIndexes($class)
    {
        $indexes = [];
        $classIndexes = Config::inst()->get($class, 'indexes', Config::UNINHERITED) ?: [];
        foreach ($classIndexes as $indexName => $indexSpec) {
            if (array_key_exists($indexName, $indexes)) {
                throw new InvalidArgumentException(sprintf(
                    'Index named "%s" already exists on class %s',
                    $indexName,
                    $class
                ));
            }
            if (is_array($indexSpec)) {
                if (!ArrayLib::is_associative($indexSpec)) {
                    $indexSpec = [
                        'columns' => $indexSpec,
                    ];
                }
                if (!isset($indexSpec['type'])) {
                    $indexSpec['type'] = 'index';
                }
                if (!isset($indexSpec['columns'])) {
                    $indexSpec['columns'] = [$indexName];
                } elseif (!is_array($indexSpec['columns'])) {
                    throw new InvalidArgumentException(sprintf(
                        'Index %s on %s is not valid. columns should be an array %s given',
                        var_export($indexName, true),
                        var_export($class, true),
                        var_export($indexSpec['columns'], true)
                    ));
                }
            } else {
                $indexSpec = [
                    'type' => 'index',
                    'columns' => [$indexName],
                ];
            }
            $indexes[$indexName] = $indexSpec;
        }
        return $indexes;
    }
134412
public function getSpecificSubclassMapping(string $class): self
    {
        if ($this->class->getClassName() === $class) {
            return $this;
        }

        if (!is_subclass_of($class, $this->class->getClassName(), true)) {
            throw InvalidArgumentException::format(
                'Invalid class supplied to %s: must be a subclass of %s, %s given',
                __METHOD__, $this->class->getClassName(), $class
            );
        }

        foreach ($this->subClassMappings as $mapping) {
            if (is_subclass_of($class, $mapping->getDefinition()->getClassName(), true)) {
                return $mapping->getDefinition()->getSpecificSubclassMapping($class);
            }
        }

        throw InvalidArgumentException::format(
            'Invalid class supplied to %s: cannot find mapping for %s',
            __METHOD__, $class
        );
    }
1226134
public function findAnnotationClass(string $class): ?string
    {
        $annotationClass = "";

        // Handle exact class name matches, including aliases classes...
        if(array_key_exists($class, $this->uses))
            $annotationClass = $this->uses[$class];

        // Handle fully qualified class names...
        if($annotationClass === "" && in_array($class, $this->uses))
        {
            $key = array_search($class, $this->uses);
            $annotationClass = $this->uses[$key];
        }

        // Determine the current classes namespace...
        $namespaceParts = explode("\\", $this->class);
        array_pop($namespaceParts);
        $namespace = implode("\\", $namespaceParts)."\\";

        // Handle class names living in the same namespace...
        if($annotationClass === "" && class_exists($namespace.$class))
            $annotationClass = $namespace.$class;

        // Make certain the class exists before continuing...
        if ($annotationClass !== "" && class_exists($annotationClass))
        {
            // TODO: Handle the situation where '@var ClassName' is not meant to be an Annotation class...

            /*
            // Also make certain the class extends 'Annotation'...
            if (!is_subclass_of($annotationClass, Annotation::class, true)) {
                throw new \Exception("[MVQN\Annotations\AnnotationReader] The annotation class '$annotationClass' ".
                    "must extend '".Annotation::class."'!");
            }
            */
            // Return the fully qualified class, if nothing went wrong!
            return $annotationClass;
        }

        // If nothing else matched, then throw an exception!
        throw new \Exception("[MVQN\Annotations\AnnotationReader] The annotation class '$class' must exist and ".
            "extend '".Annotation::class . "'!");
        //return null;
    }