3 use Symfony\Component\Routing\Exception\MethodNotAllowedException;
4 use Symfony\Component\Routing\Exception\ResourceNotFoundException;
5 use Symfony\Component\Routing\RequestContext;
8 * This class has been auto-generated
9 * by the Symfony Routing Component.
11 class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
13 public function __construct(RequestContext $context)
15 $this->context = $context;
18 public function match($rawPathinfo)
21 $pathinfo = rawurldecode($rawPathinfo);
22 $trimmedPathinfo = rtrim($pathinfo, '/');
23 $context = $this->context;
24 $request = $this->request ?: $this->createRequest($pathinfo);
25 $requestMethod = $canonicalMethod = $context->getMethod();
27 if ('HEAD' === $requestMethod) {
28 $canonicalMethod = 'GET';
31 if (0 === strpos($pathinfo, '/trailing/simple')) {
32 // simple_trailing_slash_no_methods
33 if ('/trailing/simple/no-methods/' === $pathinfo) {
34 return array('_route' => 'simple_trailing_slash_no_methods');
37 // simple_trailing_slash_GET_method
38 if ('/trailing/simple/get-method/' === $pathinfo) {
39 $ret = array('_route' => 'simple_trailing_slash_GET_method');
40 if (!in_array($canonicalMethod, array('GET'))) {
41 $allow = array_merge($allow, array('GET'));
42 goto not_simple_trailing_slash_GET_method;
47 not_simple_trailing_slash_GET_method:
49 // simple_trailing_slash_HEAD_method
50 if ('/trailing/simple/head-method/' === $pathinfo) {
51 $ret = array('_route' => 'simple_trailing_slash_HEAD_method');
52 if (!in_array($requestMethod, array('HEAD'))) {
53 $allow = array_merge($allow, array('HEAD'));
54 goto not_simple_trailing_slash_HEAD_method;
59 not_simple_trailing_slash_HEAD_method:
61 // simple_trailing_slash_POST_method
62 if ('/trailing/simple/post-method/' === $pathinfo) {
63 $ret = array('_route' => 'simple_trailing_slash_POST_method');
64 if (!in_array($requestMethod, array('POST'))) {
65 $allow = array_merge($allow, array('POST'));
66 goto not_simple_trailing_slash_POST_method;
71 not_simple_trailing_slash_POST_method:
75 elseif (0 === strpos($pathinfo, '/trailing/regex')) {
76 // regex_trailing_slash_no_methods
77 if (0 === strpos($pathinfo, '/trailing/regex/no-methods') && preg_match('#^/trailing/regex/no\\-methods/(?P<param>[^/]++)/$#sD', $pathinfo, $matches)) {
78 return $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_no_methods')), array ());
81 // regex_trailing_slash_GET_method
82 if (0 === strpos($pathinfo, '/trailing/regex/get-method') && preg_match('#^/trailing/regex/get\\-method/(?P<param>[^/]++)/$#sD', $pathinfo, $matches)) {
83 $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_GET_method')), array ());
84 if (!in_array($canonicalMethod, array('GET'))) {
85 $allow = array_merge($allow, array('GET'));
86 goto not_regex_trailing_slash_GET_method;
91 not_regex_trailing_slash_GET_method:
93 // regex_trailing_slash_HEAD_method
94 if (0 === strpos($pathinfo, '/trailing/regex/head-method') && preg_match('#^/trailing/regex/head\\-method/(?P<param>[^/]++)/$#sD', $pathinfo, $matches)) {
95 $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_HEAD_method')), array ());
96 if (!in_array($requestMethod, array('HEAD'))) {
97 $allow = array_merge($allow, array('HEAD'));
98 goto not_regex_trailing_slash_HEAD_method;
103 not_regex_trailing_slash_HEAD_method:
105 // regex_trailing_slash_POST_method
106 if (0 === strpos($pathinfo, '/trailing/regex/post-method') && preg_match('#^/trailing/regex/post\\-method/(?P<param>[^/]++)/$#sD', $pathinfo, $matches)) {
107 $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_POST_method')), array ());
108 if (!in_array($requestMethod, array('POST'))) {
109 $allow = array_merge($allow, array('POST'));
110 goto not_regex_trailing_slash_POST_method;
115 not_regex_trailing_slash_POST_method:
119 elseif (0 === strpos($pathinfo, '/not-trailing/simple')) {
120 // simple_not_trailing_slash_no_methods
121 if ('/not-trailing/simple/no-methods' === $pathinfo) {
122 return array('_route' => 'simple_not_trailing_slash_no_methods');
125 // simple_not_trailing_slash_GET_method
126 if ('/not-trailing/simple/get-method' === $pathinfo) {
127 $ret = array('_route' => 'simple_not_trailing_slash_GET_method');
128 if (!in_array($canonicalMethod, array('GET'))) {
129 $allow = array_merge($allow, array('GET'));
130 goto not_simple_not_trailing_slash_GET_method;
135 not_simple_not_trailing_slash_GET_method:
137 // simple_not_trailing_slash_HEAD_method
138 if ('/not-trailing/simple/head-method' === $pathinfo) {
139 $ret = array('_route' => 'simple_not_trailing_slash_HEAD_method');
140 if (!in_array($requestMethod, array('HEAD'))) {
141 $allow = array_merge($allow, array('HEAD'));
142 goto not_simple_not_trailing_slash_HEAD_method;
147 not_simple_not_trailing_slash_HEAD_method:
149 // simple_not_trailing_slash_POST_method
150 if ('/not-trailing/simple/post-method' === $pathinfo) {
151 $ret = array('_route' => 'simple_not_trailing_slash_POST_method');
152 if (!in_array($requestMethod, array('POST'))) {
153 $allow = array_merge($allow, array('POST'));
154 goto not_simple_not_trailing_slash_POST_method;
159 not_simple_not_trailing_slash_POST_method:
163 elseif (0 === strpos($pathinfo, '/not-trailing/regex')) {
164 // regex_not_trailing_slash_no_methods
165 if (0 === strpos($pathinfo, '/not-trailing/regex/no-methods') && preg_match('#^/not\\-trailing/regex/no\\-methods/(?P<param>[^/]++)$#sD', $pathinfo, $matches)) {
166 return $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_no_methods')), array ());
169 // regex_not_trailing_slash_GET_method
170 if (0 === strpos($pathinfo, '/not-trailing/regex/get-method') && preg_match('#^/not\\-trailing/regex/get\\-method/(?P<param>[^/]++)$#sD', $pathinfo, $matches)) {
171 $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_GET_method')), array ());
172 if (!in_array($canonicalMethod, array('GET'))) {
173 $allow = array_merge($allow, array('GET'));
174 goto not_regex_not_trailing_slash_GET_method;
179 not_regex_not_trailing_slash_GET_method:
181 // regex_not_trailing_slash_HEAD_method
182 if (0 === strpos($pathinfo, '/not-trailing/regex/head-method') && preg_match('#^/not\\-trailing/regex/head\\-method/(?P<param>[^/]++)$#sD', $pathinfo, $matches)) {
183 $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_HEAD_method')), array ());
184 if (!in_array($requestMethod, array('HEAD'))) {
185 $allow = array_merge($allow, array('HEAD'));
186 goto not_regex_not_trailing_slash_HEAD_method;
191 not_regex_not_trailing_slash_HEAD_method:
193 // regex_not_trailing_slash_POST_method
194 if (0 === strpos($pathinfo, '/not-trailing/regex/post-method') && preg_match('#^/not\\-trailing/regex/post\\-method/(?P<param>[^/]++)$#sD', $pathinfo, $matches)) {
195 $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_POST_method')), array ());
196 if (!in_array($requestMethod, array('POST'))) {
197 $allow = array_merge($allow, array('POST'));
198 goto not_regex_not_trailing_slash_POST_method;
203 not_regex_not_trailing_slash_POST_method:
207 if ('/' === $pathinfo && !$allow) {
208 throw new Symfony\Component\Routing\Exception\NoConfigurationException();
211 throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();