original_string: public static function alias($alias, $source)
      {
          if (empty(static::$_config[$source]) && empty(static::$_config[$alias])) {
              throw new MissingDatasourceConfigException(
                  sprintf('Cannot create alias of "%s" as it does not exist.', $alias)
              );
          }
          static::$_aliasMap[$source] = $alias;
      }
code: public static function alias($alias, $source)
      {
          if (empty(static::$_config[$source]) && empty(static::$_config[$alias])) {
              throw new MissingDatasourceConfigException(
                  sprintf('Cannot create alias of "%s" as it does not exist.', $alias)
              );
          }
          static::$_aliasMap[$source] = $alias;
      }
code_tokens: public static function alias ( $ alias , $ source ) { if ( empty ( static :: $ _config [ $ source ] ) && empty ( static :: $ _config [ $ alias ] ) ) { throw new MissingDatasourceConfigException ( sprintf ( 'Cannot create alias of "%s" as it does not exist.' , $ alias ) ) ; } static :: $ _aliasMap [ $ source ] = $ alias ; }
docstring: Set one or more connection aliases.
  
  Connection aliases allow you to rename active connections without overwriting
  the aliased connection. This is most useful in the test-suite for replacing
  connections with their test variant.
  
  Defined aliases will take precedence over normal connection names. For example,
  if you alias 'default' to 'test', fetching 'default' will always return the 'test'
  connection as long as the alias is defined.
  
  You can remove aliases with ConnectionManager::dropAlias().
  
  ### Usage
  
  ```
  // Make 'things' resolve to 'test_things' connection
  ConnectionManager::alias('test_things', 'things');
  ```
  
  @param string $alias The alias to add. Fetching $source will return $alias when loaded with get.
  @param string $source The connection to add an alias to.
  @return void
  @throws \Cake\Datasource\Exception\MissingDatasourceConfigException When aliasing a
  connection that does not exist.
docstring_tokens: Set one or more connection aliases .