url_matcher0.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. use Symfony\Component\Routing\Exception\MethodNotAllowedException;
  3. use Symfony\Component\Routing\Exception\ResourceNotFoundException;
  4. use Symfony\Component\Routing\RequestContext;
  5. /**
  6. * This class has been auto-generated
  7. * by the Symfony Routing Component.
  8. */
  9. class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
  10. {
  11. public function __construct(RequestContext $context)
  12. {
  13. $this->context = $context;
  14. }
  15. public function match($rawPathinfo)
  16. {
  17. $allow = [];
  18. $pathinfo = rawurldecode($rawPathinfo);
  19. $trimmedPathinfo = rtrim($pathinfo, '/');
  20. $context = $this->context;
  21. $request = $this->request ?: $this->createRequest($pathinfo);
  22. $requestMethod = $canonicalMethod = $context->getMethod();
  23. if ('HEAD' === $requestMethod) {
  24. $canonicalMethod = 'GET';
  25. }
  26. if ('/' === $pathinfo && !$allow) {
  27. throw new Symfony\Component\Routing\Exception\NoConfigurationException();
  28. }
  29. throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
  30. }
  31. }