@@ -23,7 +23,6 @@ public function match($rawPathinfo)
2323 $ context = $ this ->context ;
2424 $ request = $ this ->request ?: $ this ->createRequest ($ pathinfo );
2525 $ requestMethod = $ canonicalMethod = $ context ->getMethod ();
26- $ scheme = $ context ->getScheme ();
2726
2827 if ('HEAD ' === $ requestMethod ) {
2928 $ canonicalMethod = 'GET ' ;
@@ -58,7 +57,7 @@ public function match($rawPathinfo)
5857 $ ret = array ('_route ' => 'a_fourth ' );
5958 if ('/ ' === substr ($ pathinfo , -1 )) {
6059 // no-op
61- } elseif (! in_array ( $ this -> context -> getMethod (), array ( ' HEAD ' , ' GET ')) ) {
60+ } elseif (' GET ' !== $ canonicalMethod ) {
6261 goto not_a_fourth;
6362 } else {
6463 return array_replace ($ ret , $ this ->redirect ($ rawPathinfo .'/ ' , 'a_fourth ' ));
@@ -73,7 +72,7 @@ public function match($rawPathinfo)
7372 $ ret = array ('_route ' => 'a_fifth ' );
7473 if ('/ ' === substr ($ pathinfo , -1 )) {
7574 // no-op
76- } elseif (! in_array ( $ this -> context -> getMethod (), array ( ' HEAD ' , ' GET ')) ) {
75+ } elseif (' GET ' !== $ canonicalMethod ) {
7776 goto not_a_fifth;
7877 } else {
7978 return array_replace ($ ret , $ this ->redirect ($ rawPathinfo .'/ ' , 'a_fifth ' ));
@@ -88,7 +87,7 @@ public function match($rawPathinfo)
8887 $ ret = array ('_route ' => 'a_sixth ' );
8988 if ('/ ' === substr ($ pathinfo , -1 )) {
9089 // no-op
91- } elseif (! in_array ( $ this -> context -> getMethod (), array ( ' HEAD ' , ' GET ')) ) {
90+ } elseif (' GET ' !== $ canonicalMethod ) {
9291 goto not_a_sixth;
9392 } else {
9493 return array_replace ($ ret , $ this ->redirect ($ rawPathinfo .'/ ' , 'a_sixth ' ));
@@ -111,7 +110,7 @@ public function match($rawPathinfo)
111110 $ ret = array ('_route ' => 'nested_a ' );
112111 if ('/ ' === substr ($ pathinfo , -1 )) {
113112 // no-op
114- } elseif (! in_array ( $ this -> context -> getMethod (), array ( ' HEAD ' , ' GET ')) ) {
113+ } elseif (' GET ' !== $ canonicalMethod ) {
115114 goto not_nested_a;
116115 } else {
117116 return array_replace ($ ret , $ this ->redirect ($ rawPathinfo .'/ ' , 'nested_a ' ));
@@ -126,7 +125,7 @@ public function match($rawPathinfo)
126125 $ ret = array ('_route ' => 'nested_b ' );
127126 if ('/ ' === substr ($ pathinfo , -1 )) {
128127 // no-op
129- } elseif (! in_array ( $ this -> context -> getMethod (), array ( ' HEAD ' , ' GET ')) ) {
128+ } elseif (' GET ' !== $ canonicalMethod ) {
130129 goto not_nested_b;
131130 } else {
132131 return array_replace ($ ret , $ this ->redirect ($ rawPathinfo .'/ ' , 'nested_b ' ));
@@ -141,7 +140,7 @@ public function match($rawPathinfo)
141140 $ ret = array ('_route ' => 'nested_c ' );
142141 if ('/ ' === substr ($ pathinfo , -1 )) {
143142 // no-op
144- } elseif (! in_array ( $ this -> context -> getMethod (), array ( ' HEAD ' , ' GET ')) ) {
143+ } elseif (' GET ' !== $ canonicalMethod ) {
145144 goto not_nested_c;
146145 } else {
147146 return array_replace ($ ret , $ this ->redirect ($ rawPathinfo .'/ ' , 'nested_c ' ));
@@ -159,7 +158,7 @@ public function match($rawPathinfo)
159158 $ ret = array ('_route ' => 'slashed_a ' );
160159 if ('/ ' === substr ($ pathinfo , -1 )) {
161160 // no-op
162- } elseif (! in_array ( $ this -> context -> getMethod (), array ( ' HEAD ' , ' GET ')) ) {
161+ } elseif (' GET ' !== $ canonicalMethod ) {
163162 goto not_slashed_a;
164163 } else {
165164 return array_replace ($ ret , $ this ->redirect ($ rawPathinfo .'/ ' , 'slashed_a ' ));
@@ -174,7 +173,7 @@ public function match($rawPathinfo)
174173 $ ret = array ('_route ' => 'slashed_b ' );
175174 if ('/ ' === substr ($ pathinfo , -1 )) {
176175 // no-op
177- } elseif (! in_array ( $ this -> context -> getMethod (), array ( ' HEAD ' , ' GET ')) ) {
176+ } elseif (' GET ' !== $ canonicalMethod ) {
178177 goto not_slashed_b;
179178 } else {
180179 return array_replace ($ ret , $ this ->redirect ($ rawPathinfo .'/ ' , 'slashed_b ' ));
@@ -189,7 +188,7 @@ public function match($rawPathinfo)
189188 $ ret = array ('_route ' => 'slashed_c ' );
190189 if ('/ ' === substr ($ pathinfo , -1 )) {
191190 // no-op
192- } elseif (! in_array ( $ this -> context -> getMethod (), array ( ' HEAD ' , ' GET ')) ) {
191+ } elseif (' GET ' !== $ canonicalMethod ) {
193192 goto not_slashed_c;
194193 } else {
195194 return array_replace ($ ret , $ this ->redirect ($ rawPathinfo .'/ ' , 'slashed_c ' ));
0 commit comments