public function 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

drupal/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/Tests/Routing/RouteMock.php, line 29

Class

RouteMock

Namespace

Symfony\Cmf\Component\Routing\Tests\Routing

Code

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