Register an alias for a class

@param string  $class The original
@param string  $alias The alias name for the class.
8085
public function registerAlias($class, $alias)
    {
        $alias = trim($alias);
        $class = trim($class);

        $this->__registry->alias($class, $alias);
    }
1361600
protected function aliasAction($alias)
    {
        $request = $this->getRequest();
        $request->setActionName($alias);
        $request->setParam($request->getActionKey(), $alias);
    }
372041
public function addClassAlias($alias, $class)
    {
        $alias = static::normalise($alias);
        $class = static::normalise($class);

        $this->classAliases[$alias] = $class;

        return $this;
    }
669738
public function match($alias, $class)
    {
        foreach (['*', $alias] as $key) {
            if ($props = $this->getNamespace($key)) {
                if ($this->matchGroup($props, $alias, $class)) {
                    return true;
                }
            }
        }

        return false;
    }
112562
public function alias(string $alias, string $original)
    {
        $this->aliases[$alias] = $this->getRealId($original);

        return $this;
    }
632655
protected function registerClassAliases()
    {
        $aliases = __config()->class_aliases;
        if (!empty($aliases)) {
            $aliasLoader = new AliasLoader($aliases);
            spl_autoload_register([$aliasLoader, 'load']);
        }
    }
1286292
public void register(String local, String alias) {
        Map<String, String> map = local.contains("*") || local.contains("?") ? wildcardMap : aliasMap;
        
        if (alias == null) {
            map.remove(local);
            return;
        }
        
        String oldAlias = map.get(local);
        
        if (oldAlias != null) {
            if (oldAlias.equals(alias)) {
                return;
            }
            
            if (log.isInfoEnabled()) {
                log.info(StrUtil.formatMessage("Replaced %s alias for '%s':  old value ='%s', new value ='%s'.", getName(),
                    local, oldAlias, alias));
            }
        }
        map.put(local, alias);
    }
1297264
public static void register(String type, String local, String alias) {
        instance.get(type).register(local, alias);
    }
224490
public function clear($class)
    {
        $concrete = $this->getAlias($class);
        unset($this->_aliases[$class]);

        unset($this->_definitions[$concrete], $this->_singletons[$concrete]);
    }
1049388
public static function define($alias, $class)
    {
        $reflection = new \ReflectionClass($class);

        if (!$reflection->isSubclassOf('Predis\Profile\ProfileInterface')) {
            throw new \InvalidArgumentException("The class '$class' is not a valid profile class.");
        }

        self::$profiles[$alias] = $class;
    }
565356
public function aliasHelper(string $alias)
    {
        if (!($this instanceof AliasInterface)) {
            throw RegisterException::noAlias();
        }
        if (!$alias) {
            throw RegisterException::blank();
        }
        if ($this instanceof ContainerAwareInterface && $this->isBound()) {
            if (!$this->getManager()->isRegistered($alias)) {
                $this->getManager()->register($this, $alias);
            }
        }
    }
276783
public function aliasClass($class)
    {
        if (Str::contains($class, '\\')) {
            return;
        }

        $fullName = isset($this->classes[$class])
            ? $this->classes[$class]
            : false;

        if ($fullName) {
            $this->shell->writeStdout("[!] Aliasing '{$class}' to '{$fullName}' for this Tinker session.\n");

            class_alias($fullName, $class);
        }
    }
840189
static function setAlias($name, $alias)
    {
        if (!is_array($alias))
            $alias = array($alias);

        foreach($alias as $a)
            self::$_aliases[(string) $a] = (string) $name;
    }
749157
public function addUse($class, $alias = null)
    {
        $as = $alias == null ? (int)(count($this->uses) + 1) : $alias;
        $this->uses[$as] = (string)$class;
        return $this;
    }
996666
public function resolve(string $alias) : bool
    {
        // return false if alias already resolved.
        if (in_array($alias, $this->resolved)) {
            return false;
        }

        $this->resolved[] = $alias;

        // Resolve class alias if set.
        if ($this->has($alias)) {
            $class = $this->get($alias);
            $class = (class_exists($class, true)) ? $class : false;
        } else {
            // Resolve namespace alias.
            $class = $this->resolveNamespaceAlias($alias);
        }

        // Remove the resolved class
        array_pop($this->resolved);

        // If class exists create and return a alias of the class.
        return (!class_exists($class)) ? false : class_alias($class, $alias);
    }
206312
public function registerAliases(array $aliasGroup)
    {
        foreach ($aliasGroup as $key => $aliases) {
            foreach ($aliases as $alias) {
                $this->app->alias($key, $alias);
            }
        }
    }
251729
public static function registerType(string $type, string $class): void
    {
        if (isset(static::$types[$type])) {
            throw new ConfigException("Can not register database type={$type} when it was already registered");
        }

        static::$types[$type] = $class;
    }