@@ -37,8 +37,8 @@ public function match($rawPathinfo)
3737 // simple_trailing_slash_GET_method
3838 if ('/trailing/simple/get-method/ ' === $ pathinfo ) {
3939 $ ret = array ('_route ' => 'simple_trailing_slash_GET_method ' );
40- if (' GET ' !== $ canonicalMethod ) {
41- $ allow[] = 'GET ' ;
40+ if (! in_array ( $ canonicalMethod, array ( ' GET ' )) ) {
41+ $ allow = array_merge ( $ allow , array ( 'GET ' )) ;
4242 goto not_simple_trailing_slash_GET_method;
4343 }
4444
@@ -49,8 +49,8 @@ public function match($rawPathinfo)
4949 // simple_trailing_slash_HEAD_method
5050 if ('/trailing/simple/head-method/ ' === $ pathinfo ) {
5151 $ ret = array ('_route ' => 'simple_trailing_slash_HEAD_method ' );
52- if (' HEAD ' !== $ requestMethod ) {
53- $ allow[] = 'HEAD ' ;
52+ if (! in_array ( $ requestMethod, array ( ' HEAD ' )) ) {
53+ $ allow = array_merge ( $ allow , array ( 'HEAD ' )) ;
5454 goto not_simple_trailing_slash_HEAD_method;
5555 }
5656
@@ -61,8 +61,8 @@ public function match($rawPathinfo)
6161 // simple_trailing_slash_POST_method
6262 if ('/trailing/simple/post-method/ ' === $ pathinfo ) {
6363 $ ret = array ('_route ' => 'simple_trailing_slash_POST_method ' );
64- if ('POST ' !== $ canonicalMethod ) {
65- $ allow[] = 'POST ' ;
64+ if (! in_array ( $ requestMethod , array ( 'POST ' )) ) {
65+ $ allow = array_merge ( $ allow , array ( 'POST ' )) ;
6666 goto not_simple_trailing_slash_POST_method;
6767 }
6868
@@ -81,8 +81,8 @@ public function match($rawPathinfo)
8181 // regex_trailing_slash_GET_method
8282 if (0 === strpos ($ pathinfo , '/trailing/regex/get-method ' ) && preg_match ('#^/trailing/regex/get \\-method/(?P<param>[^/]++)/$#sD ' , $ pathinfo , $ matches )) {
8383 $ ret = $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'regex_trailing_slash_GET_method ' )), array ());
84- if (' GET ' !== $ canonicalMethod ) {
85- $ allow[] = 'GET ' ;
84+ if (! in_array ( $ canonicalMethod, array ( ' GET ' )) ) {
85+ $ allow = array_merge ( $ allow , array ( 'GET ' )) ;
8686 goto not_regex_trailing_slash_GET_method;
8787 }
8888
@@ -93,8 +93,8 @@ public function match($rawPathinfo)
9393 // regex_trailing_slash_HEAD_method
9494 if (0 === strpos ($ pathinfo , '/trailing/regex/head-method ' ) && preg_match ('#^/trailing/regex/head \\-method/(?P<param>[^/]++)/$#sD ' , $ pathinfo , $ matches )) {
9595 $ ret = $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'regex_trailing_slash_HEAD_method ' )), array ());
96- if (' HEAD ' !== $ requestMethod ) {
97- $ allow[] = 'HEAD ' ;
96+ if (! in_array ( $ requestMethod, array ( ' HEAD ' )) ) {
97+ $ allow = array_merge ( $ allow , array ( 'HEAD ' )) ;
9898 goto not_regex_trailing_slash_HEAD_method;
9999 }
100100
@@ -105,8 +105,8 @@ public function match($rawPathinfo)
105105 // regex_trailing_slash_POST_method
106106 if (0 === strpos ($ pathinfo , '/trailing/regex/post-method ' ) && preg_match ('#^/trailing/regex/post \\-method/(?P<param>[^/]++)/$#sD ' , $ pathinfo , $ matches )) {
107107 $ ret = $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'regex_trailing_slash_POST_method ' )), array ());
108- if ('POST ' !== $ canonicalMethod ) {
109- $ allow[] = 'POST ' ;
108+ if (! in_array ( $ requestMethod , array ( 'POST ' )) ) {
109+ $ allow = array_merge ( $ allow , array ( 'POST ' )) ;
110110 goto not_regex_trailing_slash_POST_method;
111111 }
112112
@@ -125,8 +125,8 @@ public function match($rawPathinfo)
125125 // simple_not_trailing_slash_GET_method
126126 if ('/not-trailing/simple/get-method ' === $ pathinfo ) {
127127 $ ret = array ('_route ' => 'simple_not_trailing_slash_GET_method ' );
128- if (' GET ' !== $ canonicalMethod ) {
129- $ allow[] = 'GET ' ;
128+ if (! in_array ( $ canonicalMethod, array ( ' GET ' )) ) {
129+ $ allow = array_merge ( $ allow , array ( 'GET ' )) ;
130130 goto not_simple_not_trailing_slash_GET_method;
131131 }
132132
@@ -137,8 +137,8 @@ public function match($rawPathinfo)
137137 // simple_not_trailing_slash_HEAD_method
138138 if ('/not-trailing/simple/head-method ' === $ pathinfo ) {
139139 $ ret = array ('_route ' => 'simple_not_trailing_slash_HEAD_method ' );
140- if (' HEAD ' !== $ requestMethod ) {
141- $ allow[] = 'HEAD ' ;
140+ if (! in_array ( $ requestMethod, array ( ' HEAD ' )) ) {
141+ $ allow = array_merge ( $ allow , array ( 'HEAD ' )) ;
142142 goto not_simple_not_trailing_slash_HEAD_method;
143143 }
144144
@@ -149,8 +149,8 @@ public function match($rawPathinfo)
149149 // simple_not_trailing_slash_POST_method
150150 if ('/not-trailing/simple/post-method ' === $ pathinfo ) {
151151 $ ret = array ('_route ' => 'simple_not_trailing_slash_POST_method ' );
152- if ('POST ' !== $ canonicalMethod ) {
153- $ allow[] = 'POST ' ;
152+ if (! in_array ( $ requestMethod , array ( 'POST ' )) ) {
153+ $ allow = array_merge ( $ allow , array ( 'POST ' )) ;
154154 goto not_simple_not_trailing_slash_POST_method;
155155 }
156156
@@ -169,8 +169,8 @@ public function match($rawPathinfo)
169169 // regex_not_trailing_slash_GET_method
170170 if (0 === strpos ($ pathinfo , '/not-trailing/regex/get-method ' ) && preg_match ('#^/not \\-trailing/regex/get \\-method/(?P<param>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
171171 $ ret = $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'regex_not_trailing_slash_GET_method ' )), array ());
172- if (' GET ' !== $ canonicalMethod ) {
173- $ allow[] = 'GET ' ;
172+ if (! in_array ( $ canonicalMethod, array ( ' GET ' )) ) {
173+ $ allow = array_merge ( $ allow , array ( 'GET ' )) ;
174174 goto not_regex_not_trailing_slash_GET_method;
175175 }
176176
@@ -181,8 +181,8 @@ public function match($rawPathinfo)
181181 // regex_not_trailing_slash_HEAD_method
182182 if (0 === strpos ($ pathinfo , '/not-trailing/regex/head-method ' ) && preg_match ('#^/not \\-trailing/regex/head \\-method/(?P<param>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
183183 $ ret = $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'regex_not_trailing_slash_HEAD_method ' )), array ());
184- if (' HEAD ' !== $ requestMethod ) {
185- $ allow[] = 'HEAD ' ;
184+ if (! in_array ( $ requestMethod, array ( ' HEAD ' )) ) {
185+ $ allow = array_merge ( $ allow , array ( 'HEAD ' )) ;
186186 goto not_regex_not_trailing_slash_HEAD_method;
187187 }
188188
@@ -193,8 +193,8 @@ public function match($rawPathinfo)
193193 // regex_not_trailing_slash_POST_method
194194 if (0 === strpos ($ pathinfo , '/not-trailing/regex/post-method ' ) && preg_match ('#^/not \\-trailing/regex/post \\-method/(?P<param>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
195195 $ ret = $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'regex_not_trailing_slash_POST_method ' )), array ());
196- if ('POST ' !== $ canonicalMethod ) {
197- $ allow[] = 'POST ' ;
196+ if (! in_array ( $ requestMethod , array ( 'POST ' )) ) {
197+ $ allow = array_merge ( $ allow , array ( 'POST ' )) ;
198198 goto not_regex_not_trailing_slash_POST_method;
199199 }
200200
0 commit comments