You are here

public function RouteMock::getRequirement in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony-cmf/routing/Tests/Routing/RouteMock.php \Symfony\Cmf\Component\Routing\Tests\Routing\RouteMock::getRequirement()

Returns the requirement for the given key.

Parameters

string $key The key:

Return value

string|null The regex or null when not given

Overrides Route::getRequirement

File

vendor/symfony-cmf/routing/Tests/Routing/RouteMock.php, line 42

Class

RouteMock

Namespace

Symfony\Cmf\Component\Routing\Tests\Routing

Code

public function getRequirement($key) {
  if (!$key == '_locale') {
    throw new \Exception();
  }
  return $this->locale;
}