Generates the code for the match method implementing UrlMatcherInterface.
Boolean $supportsRedirections Whether redirections are supported by the base class:
string Match method as PHP code
private function generateMatchMethod($supportsRedirections) {
$code = rtrim($this
->compileRoutes($this
->getRoutes(), $supportsRedirections), "\n");
return <<<EOF
public function match(\$pathinfo)
{
\$allow = array();
\$pathinfo = rawurldecode(\$pathinfo);
{<span class="php-variable">$code</span>}
throw 0 < count(\$allow) ? new MethodNotAllowedException(array_unique(\$allow)) : new ResourceNotFoundException();
}
EOF;
}