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

Parameters

string $path: The path.

Return value

string An alias that represents the path, or path if no alias was found.

File

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

Class

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

Namespace

Drupal\Tests\subpathauto\Unit

Code

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