Skip to content

Commit cce1615

Browse files
committed
Revert "fixed typo"
This reverts commit 6830d9f4c904d74020d2619fae990670edb3c3de.
1 parent 73a95f6 commit cce1615

File tree

3 files changed

+91
-54
lines changed

3 files changed

+91
-54
lines changed

Tests/Fixtures/dumper/url_matcher1.php

Lines changed: 43 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function match($pathinfo)
2929

3030
// foo
3131
if (0 === strpos($pathinfo, '/foo') && preg_match('#^/foo/(?P<bar>baz|symfony)$#s', $pathinfo, $matches)) {
32-
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo')), array('def' => 'test'));
32+
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo')), array ( 'def' => 'test',));
3333
}
3434

3535
if (0 === strpos($pathinfo, '/bar')) {
@@ -40,7 +40,7 @@ public function match($pathinfo)
4040
goto not_bar;
4141
}
4242

43-
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar')), array());
43+
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar')), array ());
4444
}
4545
not_bar:
4646

@@ -51,9 +51,10 @@ public function match($pathinfo)
5151
goto not_barhead;
5252
}
5353

54-
return $this->mergeDefaults(array_replace($matches, array('_route' => 'barhead')), array());
54+
return $this->mergeDefaults(array_replace($matches, array('_route' => 'barhead')), array ());
5555
}
5656
not_barhead:
57+
5758
}
5859

5960
if (0 === strpos($pathinfo, '/test')) {
@@ -72,11 +73,12 @@ public function match($pathinfo)
7273
if ($pathinfo === '/test/baz3/') {
7374
return array('_route' => 'baz3');
7475
}
76+
7577
}
7678

7779
// baz4
7880
if (preg_match('#^/test/(?P<foo>[^/]++)/$#s', $pathinfo, $matches)) {
79-
return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz4')), array());
81+
return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz4')), array ());
8082
}
8183

8284
// baz5
@@ -86,7 +88,7 @@ public function match($pathinfo)
8688
goto not_baz5;
8789
}
8890

89-
return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz5')), array());
91+
return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz5')), array ());
9092
}
9193
not_baz5:
9294

@@ -97,19 +99,20 @@ public function match($pathinfo)
9799
goto not_bazbaz6;
98100
}
99101

100-
return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz.baz6')), array());
102+
return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz.baz6')), array ());
101103
}
102104
not_bazbaz6:
105+
103106
}
104107

105108
// foofoo
106109
if ($pathinfo === '/foofoo') {
107-
return array('def' => 'test', '_route' => 'foofoo');
110+
return array ( 'def' => 'test', '_route' => 'foofoo',);
108111
}
109112

110113
// quoter
111114
if (preg_match('#^/(?P<quoter>[\']+)$#s', $pathinfo, $matches)) {
112-
return $this->mergeDefaults(array_replace($matches, array('_route' => 'quoter')), array());
115+
return $this->mergeDefaults(array_replace($matches, array('_route' => 'quoter')), array ());
113116
}
114117

115118
// space
@@ -121,37 +124,40 @@ public function match($pathinfo)
121124
if (0 === strpos($pathinfo, '/a/b\'b')) {
122125
// foo1
123126
if (preg_match('#^/a/b\'b/(?P<foo>[^/]++)$#s', $pathinfo, $matches)) {
124-
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo1')), array());
127+
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo1')), array ());
125128
}
126129

127130
// bar1
128131
if (preg_match('#^/a/b\'b/(?P<bar>[^/]++)$#s', $pathinfo, $matches)) {
129-
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar1')), array());
132+
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar1')), array ());
130133
}
134+
131135
}
132136

133137
// overridden
134138
if (preg_match('#^/a/(?P<var>.*)$#s', $pathinfo, $matches)) {
135-
return $this->mergeDefaults(array_replace($matches, array('_route' => 'overridden')), array());
139+
return $this->mergeDefaults(array_replace($matches, array('_route' => 'overridden')), array ());
136140
}
137141

138142
if (0 === strpos($pathinfo, '/a/b\'b')) {
139143
// foo2
140144
if (preg_match('#^/a/b\'b/(?P<foo1>[^/]++)$#s', $pathinfo, $matches)) {
141-
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo2')), array());
145+
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo2')), array ());
142146
}
143147

144148
// bar2
145149
if (preg_match('#^/a/b\'b/(?P<bar1>[^/]++)$#s', $pathinfo, $matches)) {
146-
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar2')), array());
150+
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar2')), array ());
147151
}
152+
148153
}
154+
149155
}
150156

151157
if (0 === strpos($pathinfo, '/multi')) {
152158
// helloWorld
153159
if (0 === strpos($pathinfo, '/multi/hello') && preg_match('#^/multi/hello(?:/(?P<who>[^/]++))?$#s', $pathinfo, $matches)) {
154-
return $this->mergeDefaults(array_replace($matches, array('_route' => 'helloWorld')), array('who' => 'World!'));
160+
return $this->mergeDefaults(array_replace($matches, array('_route' => 'helloWorld')), array ( 'who' => 'World!',));
155161
}
156162

157163
// overridden2
@@ -163,16 +169,17 @@ public function match($pathinfo)
163169
if ($pathinfo === '/multi/hey/') {
164170
return array('_route' => 'hey');
165171
}
172+
166173
}
167174

168175
// foo3
169176
if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P<foo>[^/]++)$#s', $pathinfo, $matches)) {
170-
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo3')), array());
177+
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo3')), array ());
171178
}
172179

173180
// bar3
174181
if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P<bar>[^/]++)$#s', $pathinfo, $matches)) {
175-
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar3')), array());
182+
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar3')), array ());
176183
}
177184

178185
if (0 === strpos($pathinfo, '/aba')) {
@@ -183,8 +190,9 @@ public function match($pathinfo)
183190

184191
// foo4
185192
if (preg_match('#^/aba/(?P<foo>[^/]++)$#s', $pathinfo, $matches)) {
186-
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo4')), array());
193+
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo4')), array ());
187194
}
195+
188196
}
189197

190198
$host = $this->context->getHost();
@@ -199,27 +207,31 @@ public function match($pathinfo)
199207
if ($pathinfo === '/c2/route2') {
200208
return array('_route' => 'route2');
201209
}
210+
202211
}
203212

204213
if (preg_match('#^b\\.example\\.com$#si', $host, $hostMatches)) {
205214
// route3
206215
if ($pathinfo === '/c2/route3') {
207216
return array('_route' => 'route3');
208217
}
218+
209219
}
210220

211221
if (preg_match('#^a\\.example\\.com$#si', $host, $hostMatches)) {
212222
// route4
213223
if ($pathinfo === '/route4') {
214224
return array('_route' => 'route4');
215225
}
226+
216227
}
217228

218229
if (preg_match('#^c\\.example\\.com$#si', $host, $hostMatches)) {
219230
// route5
220231
if ($pathinfo === '/route5') {
221232
return array('_route' => 'route5');
222233
}
234+
223235
}
224236

225237
// route6
@@ -231,43 +243,47 @@ public function match($pathinfo)
231243
if (0 === strpos($pathinfo, '/route1')) {
232244
// route11
233245
if ($pathinfo === '/route11') {
234-
return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route11')), array());
246+
return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route11')), array ());
235247
}
236248

237249
// route12
238250
if ($pathinfo === '/route12') {
239-
return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route12')), array('var1' => 'val'));
251+
return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route12')), array ( 'var1' => 'val',));
240252
}
241253

242254
// route13
243255
if (0 === strpos($pathinfo, '/route13') && preg_match('#^/route13/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
244-
return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route13')), array());
256+
return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route13')), array ());
245257
}
246258

247259
// route14
248260
if (0 === strpos($pathinfo, '/route14') && preg_match('#^/route14/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
249-
return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route14')), array('var1' => 'val'));
261+
return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route14')), array ( 'var1' => 'val',));
250262
}
263+
251264
}
265+
252266
}
253267

254268
if (preg_match('#^c\\.example\\.com$#si', $host, $hostMatches)) {
255269
// route15
256270
if (0 === strpos($pathinfo, '/route15') && preg_match('#^/route15/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
257-
return $this->mergeDefaults(array_replace($matches, array('_route' => 'route15')), array());
271+
return $this->mergeDefaults(array_replace($matches, array('_route' => 'route15')), array ());
258272
}
273+
259274
}
260275

261276
if (0 === strpos($pathinfo, '/route1')) {
262277
// route16
263278
if (0 === strpos($pathinfo, '/route16') && preg_match('#^/route16/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
264-
return $this->mergeDefaults(array_replace($matches, array('_route' => 'route16')), array('var1' => 'val'));
279+
return $this->mergeDefaults(array_replace($matches, array('_route' => 'route16')), array ( 'var1' => 'val',));
265280
}
266281

267282
// route17
268283
if ($pathinfo === '/route17') {
269284
return array('_route' => 'route17');
270285
}
286+
271287
}
272288

273289
if (0 === strpos($pathinfo, '/a')) {
@@ -279,14 +295,16 @@ public function match($pathinfo)
279295
if (0 === strpos($pathinfo, '/a/b')) {
280296
// b
281297
if (preg_match('#^/a/b/(?P<var>[^/]++)$#s', $pathinfo, $matches)) {
282-
return $this->mergeDefaults(array_replace($matches, array('_route' => 'b')), array());
298+
return $this->mergeDefaults(array_replace($matches, array('_route' => 'b')), array ());
283299
}
284300

285301
// c
286302
if (0 === strpos($pathinfo, '/a/b/c') && preg_match('#^/a/b/c/(?P<var>[^/]++)$#s', $pathinfo, $matches)) {
287-
return $this->mergeDefaults(array_replace($matches, array('_route' => 'c')), array());
303+
return $this->mergeDefaults(array_replace($matches, array('_route' => 'c')), array ());
288304
}
305+
289306
}
307+
290308
}
291309

292310
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();

0 commit comments

Comments
 (0)