@@ -37,8 +37,8 @@ public function match($rawPathinfo)
37
37
// simple_trailing_slash_GET_method
38
38
if ('/trailing/simple/get-method/ ' === $ pathinfo ) {
39
39
$ 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 ' )) ;
42
42
goto not_simple_trailing_slash_GET_method;
43
43
}
44
44
@@ -49,8 +49,8 @@ public function match($rawPathinfo)
49
49
// simple_trailing_slash_HEAD_method
50
50
if ('/trailing/simple/head-method/ ' === $ pathinfo ) {
51
51
$ 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 ' )) ;
54
54
goto not_simple_trailing_slash_HEAD_method;
55
55
}
56
56
@@ -61,8 +61,8 @@ public function match($rawPathinfo)
61
61
// simple_trailing_slash_POST_method
62
62
if ('/trailing/simple/post-method/ ' === $ pathinfo ) {
63
63
$ 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 ' )) ;
66
66
goto not_simple_trailing_slash_POST_method;
67
67
}
68
68
@@ -81,8 +81,8 @@ public function match($rawPathinfo)
81
81
// regex_trailing_slash_GET_method
82
82
if (0 === strpos ($ pathinfo , '/trailing/regex/get-method ' ) && preg_match ('#^/trailing/regex/get \\-method/(?P<param>[^/]++)/$#sD ' , $ pathinfo , $ matches )) {
83
83
$ 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 ' )) ;
86
86
goto not_regex_trailing_slash_GET_method;
87
87
}
88
88
@@ -93,8 +93,8 @@ public function match($rawPathinfo)
93
93
// regex_trailing_slash_HEAD_method
94
94
if (0 === strpos ($ pathinfo , '/trailing/regex/head-method ' ) && preg_match ('#^/trailing/regex/head \\-method/(?P<param>[^/]++)/$#sD ' , $ pathinfo , $ matches )) {
95
95
$ 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 ' )) ;
98
98
goto not_regex_trailing_slash_HEAD_method;
99
99
}
100
100
@@ -105,8 +105,8 @@ public function match($rawPathinfo)
105
105
// regex_trailing_slash_POST_method
106
106
if (0 === strpos ($ pathinfo , '/trailing/regex/post-method ' ) && preg_match ('#^/trailing/regex/post \\-method/(?P<param>[^/]++)/$#sD ' , $ pathinfo , $ matches )) {
107
107
$ 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 ' )) ;
110
110
goto not_regex_trailing_slash_POST_method;
111
111
}
112
112
@@ -125,8 +125,8 @@ public function match($rawPathinfo)
125
125
// simple_not_trailing_slash_GET_method
126
126
if ('/not-trailing/simple/get-method ' === $ pathinfo ) {
127
127
$ 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 ' )) ;
130
130
goto not_simple_not_trailing_slash_GET_method;
131
131
}
132
132
@@ -137,8 +137,8 @@ public function match($rawPathinfo)
137
137
// simple_not_trailing_slash_HEAD_method
138
138
if ('/not-trailing/simple/head-method ' === $ pathinfo ) {
139
139
$ 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 ' )) ;
142
142
goto not_simple_not_trailing_slash_HEAD_method;
143
143
}
144
144
@@ -149,8 +149,8 @@ public function match($rawPathinfo)
149
149
// simple_not_trailing_slash_POST_method
150
150
if ('/not-trailing/simple/post-method ' === $ pathinfo ) {
151
151
$ 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 ' )) ;
154
154
goto not_simple_not_trailing_slash_POST_method;
155
155
}
156
156
@@ -169,8 +169,8 @@ public function match($rawPathinfo)
169
169
// regex_not_trailing_slash_GET_method
170
170
if (0 === strpos ($ pathinfo , '/not-trailing/regex/get-method ' ) && preg_match ('#^/not \\-trailing/regex/get \\-method/(?P<param>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
171
171
$ 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 ' )) ;
174
174
goto not_regex_not_trailing_slash_GET_method;
175
175
}
176
176
@@ -181,8 +181,8 @@ public function match($rawPathinfo)
181
181
// regex_not_trailing_slash_HEAD_method
182
182
if (0 === strpos ($ pathinfo , '/not-trailing/regex/head-method ' ) && preg_match ('#^/not \\-trailing/regex/head \\-method/(?P<param>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
183
183
$ 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 ' )) ;
186
186
goto not_regex_not_trailing_slash_HEAD_method;
187
187
}
188
188
@@ -193,8 +193,8 @@ public function match($rawPathinfo)
193
193
// regex_not_trailing_slash_POST_method
194
194
if (0 === strpos ($ pathinfo , '/not-trailing/regex/post-method ' ) && preg_match ('#^/not \\-trailing/regex/post \\-method/(?P<param>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
195
195
$ 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 ' )) ;
198
198
goto not_regex_not_trailing_slash_POST_method;
199
199
}
200
200
0 commit comments