/**
  * Adds a class alias to the aliases array
  *
  *
  * @param string $original
  * @param string $alias
  * @return void
  */
 public function add($original, $alias)
 {
     $alias = Input::checkAlias($alias);
     $this->aliases[$alias] = $original;
 }
Пример #2
0
 /**
  * Adds a namespace group for a single, or all aliases
  *
  * The $alias can either be a single value or the wildcard '*' value, which
  * allows any registered alias in the namespace.
  *
  * The group can be one of the following:
  *
  *   'name'  - the alias can be called in the $namespace
  *   'path'  - the alias can be called in the $namespace and any descendants
  *   'any'   - the alias can be called in any namespace
  *
  * Namespace can either be a single string value, an array of values, or
  * missing in the case of group 'any'.
  *
  * @param string $group
  * @param string $alias
  * @param mixed $namespace
  */
 public function addNamespaceGroup($group, $alias, $namespace = null)
 {
     $namespace = Input::formatNamespace($namespace, $group);
     $this->aliasManager->addNamespace($alias, $namespace);
 }
 /**
  * Returns the group name for the namespace input type.
  *
  * @param string $namespace
  * @return string
  */
 protected function getNamespaceGroup($namespace)
 {
     $namespace = Input::checkNamespace($namespace);
     if ('*' === substr($namespace, -1)) {
         if ('*' === $namespace) {
             $group = 'any';
         } else {
             $group = 'path';
         }
     } else {
         $group = 'name';
     }
     return $group;
 }