forked from symfony/symfony
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Router] added static requirement optimization to php matcher dumper
- Loading branch information
Showing
3 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/Symfony/Component/Routing/Tests/Fixtures/dumper/optimized_route_matcher.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
use Symfony\Component\Routing\Exception\MethodNotAllowedException; | ||
use Symfony\Component\Routing\Exception\ResourceNotFoundException; | ||
use Symfony\Component\Routing\RequestContext; | ||
|
||
/** | ||
* ProjectUrlMatcher | ||
* | ||
* This class has been auto-generated | ||
* by the Symfony Routing Component. | ||
*/ | ||
class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher | ||
{ | ||
/** | ||
* Constructor. | ||
*/ | ||
public function __construct(RequestContext $context) | ||
{ | ||
$this->context = $context; | ||
} | ||
|
||
public function match($pathinfo) | ||
{ | ||
$allow = array(); | ||
$pathinfo = rawurldecode($pathinfo); | ||
|
||
// name | ||
if ($pathinfo === '/test/static') { | ||
return array ( 'param' => 'static', '_route' => 'name',); | ||
} | ||
|
||
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters