@param string      $class
@param null|string $alias
@param bool        $checkClassExists Use FALSE when you want to use a namespace instead of a class

@return $this
@throws Exception\ClassUse  When the given class does not exists
420477
public function addUse($class, $alias = null, $checkClassExists = true)
    {
        if (
            $checkClassExists === true &&
            $this->classFile->isClassDefined("\\{$class}") === false &&
            $this->classFile->isInterfaceDefined("\\{$class}") === false &&
            $this->classFile->isTraitDefined("\\{$class}") === false
        ) {
            throw Exception\ClassUse::classUseNotFound($class);
        }

        $use = new ClassUse($class, $alias);

        $this->append($use);

        return $this;
    }
154925
protected function _create($className, $alias, $config)
    {
        $authenticator = new $className($this->_identifiers, $config);
        if (!($authenticator instanceof AuthenticatorInterface)) {
            throw new RuntimeException(sprintf(
                'Authenticator class `%s` must implement \Auth\Authentication\AuthenticatorInterface',
                $className
            ));
        }

        return $authenticator;
    }
145655
public function addUse(string $use, string $alias = null)
    {
        $this->repairUse($use);

        list($class, $namespace) = $this->extractClassNameFromUse($use);

        if ($namespace === $this->namespace) {
            return $class;
        }

        $found = array_key_exists($use, $this->uses) ? $this->uses[$use] : false;

        switch (true) {
            case $found === $alias : // already used, same alias (or no alias)
                break;
            case $found === null : // already used without alias but alias provided
                throw new DuplicateUseFirstWithoutAliasException($use, $alias);
            case $found === false : // never used
                $this->uses[$use] = ($alias !== $class) ? $alias : null;
                break;
            default : // already used with different alias
                throw new DuplicateUseWithAliasException($use, $alias, $found);
        }

        return $alias ?: $class;
    }
99716
public function alias(array $class = [], string $alias = null) : Manager
    {
        if (!is_array($class)) {
            $this->set($class, $alias);

            return $this;
        }

        $this->aliases = array_merge($this->get(), $class);

        return $this;
    }
606673
public function bindClass($class, $alias = false) {

        $self  = $this;
        $clean = $alias ? $alias : \trim(\strtolower(\str_replace("\\", "/", $class)), "\\");

        $this->bind('/'.$clean.'/*', function() use($self, $class, $clean) {

            $parts      = \explode('/', \trim(\preg_replace("#$clean#","",$self["route"],1),'/'));
            $action     = isset($parts[0]) ? $parts[0]:"index";
            $params     = \count($parts)>1 ? \array_slice($parts, 1):[];

            return $self->invoke($class,$action, $params);
        });

        $this->bind('/'.$clean, function() use($self, $class) {
            return $self->invoke($class, 'index', []);
        });
    }
8757
protected function classExists(string $class, string $message): void
    {
        if (!class_exists($class)) {
            $this->log($message, Project::MSG_ERR);
            throw new BuildException($message);
        }
    }
887621
public static function loadAliases($class)
	{
		$aliases = static::$aliases;

		if (array_key_exists($class, $aliases))
		{
			return class_alias($aliases[$class], $class);
		}

		// Allow calling facade in namespaced class 
		// without resetting to the root namespace
		$classPieces = explode('\\', $class);
		$classAlt    = array_pop($classPieces);
		if (array_key_exists($classAlt, $aliases))
		{
			return class_alias($aliases[$classAlt], $class);
		}
	}
442286
protected function findMapInNamespace($class, $namespace)
    {
        $parts = explode('\\', $class);

        $baseClass = $parts[count($parts) - 1];

        $expectedClass = $namespace.$baseClass.'Map';

        if (class_exists($expectedClass)) {
            return new $expectedClass();
        }

        return false;
    }
632048
protected function matchGroup($props, $alias, $class)
    {
        if ($props['any']) {
            return true;
        }

        foreach (['path', 'name'] as $group) {
            if ($this->matchClass($props[$group], $group, $alias, $class)) {
                return true;
            }
        }

        return false;
    }
1117900
public function findClass($class) {
        $this->init();

        $fullQualifiedNamespace = $this->trimNamespace($class);

        foreach ($this->localCache as $phpClass) {
            if ($fullQualifiedNamespace === $phpClass->getFullQualifiedNamespace()) {
                return $phpClass;
            }
        }

        return false;
    }
1034478
public static Class<?> checkClassExist(String className) {
		Class<?> result = classExistCache.get(className);
		if (result != null) {
			if (ClassOrMethodNotExist.class.equals(result))
				return null;
			else
				return result;
		}
		try {
			result = Class.forName(className);
			if (result != null)
				classExistCache.put(className, result);
			else
				classExistCache.put(className, ClassOrMethodNotExist.class);
			return result;
		} catch (Exception e) {
			DialectException.eatException(e);
			classExistCache.put(className, ClassOrMethodNotExist.class);
			return null;
		}
	}
8085
public function registerAlias($class, $alias)
    {
        $alias = trim($alias);
        $class = trim($class);

        $this->__registry->alias($class, $alias);
    }
719023
public function loadClass(string $class)
    {
        if (strpos($class, 'Proxy\__Transactional__\\') !== 0) {
            return null;
        }

        if ($file = $this->findProxyFile($class)) {
            require_once $file;

            return true;
        }

        return null;
    }
1015739
public function findQueryBuilder($class, $alias = "o") {
        $em = $this->getDoctrine()->getManager();
        $qb = $em->createQueryBuilder()
                ->select($alias)
                ->from($class, $alias);
        return $qb;
    }
228544
protected function _create($class, $alias, $config)
    {
        $instance = new $class($this->_collection, $config);
        $enable = isset($config['enabled']) ? $config['enabled'] : true;
        if ($enable) {
            $this->eventManager()->on($instance);
        }
        $methods = $this->_getMethods($instance, $class, $alias);
        $this->_methodMap += $methods['methods'];
        $this->_finderMap += $methods['finders'];

        return $instance;
    }
546880
public function addImport(ClassInterface $gClass, $alias = NULL) {
    $this->imports->add($gClass, $alias);
    return $this;
  }
778392
public static function getInstance(string $checkClass) : CheckInterface
    {
        $checkClass = $checkClass;

        if (!class_exists($checkClass)) {
            throw new RuntimeException("Check class [$checkClass] does not exist");
        }

        if (!in_array(static::$interface, array_keys(class_implements($checkClass)))) {
            throw new RuntimeException("Check class [$checkClass] does not implement [" . static::$interface . "]");
        }

        return new $checkClass();
    }