Return value callback for getPathByAlias() method on the alias manager.

Ensures that by default the call to getPathAlias() will return the first argument that was passed in. We special-case the paths for which we wish it to return an actual alias.

Paramètres

string $path: The path.

Return value

string The path represented by the alias, or the alias if no path was found.

Fichier

tests/src/Unit/SubPathautoTest.php, line 303

Classe

SubPathautoTest
@coversDefaultClass \Drupal\subpathauto\PathProcessor @group subpathauto

Namespace

Drupal\Tests\subpathauto\Unit

Code

public function pathAliasCallback($path) {
    return $this->aliases[$path] ?? $path;
}