public function resolve(string $alias): ?string
    {
        // Check wether the alias matches the pattern
        if (\preg_match($this->regex, $alias, $matches) !== 1) {
            return null;
        }

        // Get the translation
        $translation = $this->translation;

        if (\mb_strpos($translation, '$') === false) {
            $class = $translation;
        } else {
            // Make sure namespace seperators are escaped
            $translation = \str_replace('\\', '\\\\', $translation);
            // Resolve the replacement
            $class = \preg_replace($this->regex, $translation, $alias);
        }

        // Check wether the class exists
        if ($class && $this->exists($class, true)) {
            return $class;
        }

        return null;
    }
public function resolve(string $alias): ?string
    {
        // Check wether the alias matches the pattern
        if (\preg_match($this->regex, $alias, $matches) !== 1) {
            return null;
        }

        // Get the translation
        $translation = $this->translation;

        if (\mb_strpos($translation, '$') === false) {
            $class = $translation;
        } else {
            // Make sure namespace seperators are escaped
            $translation = \str_replace('\\', '\\\\', $translation);
            // Resolve the replacement
            $class = \preg_replace($this->regex, $translation, $alias);
        }

        // Check wether the class exists
        if ($class && $this->exists($class, true)) {
            return $class;
        }

        return null;
    }
public function resolve ( string $ alias ) : ? string { // Check wether the alias matches the pattern if ( \ preg_match ( $ this -> regex , $ alias , $ matches ) !== 1 ) { return null ; } // Get the translation $ translation = $ this -> translation ; if ( \ mb_strpos ( $ translation , '$' ) === false ) { $ class = $ translation ; } else { // Make sure namespace seperators are escaped $ translation = \ str_replace ( '\\' , '\\\\' , $ translation ) ; // Resolve the replacement $ class = \ preg_replace ( $ this -> regex , $ translation , $ alias ) ; } // Check wether the class exists if ( $ class && $ this -> exists ( $ class , true ) ) { return $ class ; } return null ; }
Resolves an alias.

@param string $alias

@return null|string
Resolves an alias .