Skip to content

Commit 73a95f6

Browse files
committed
fixed typo
1 parent bcb28f6 commit 73a95f6

File tree

3 files changed

+54
-91
lines changed

3 files changed

+54
-91
lines changed

Tests/Fixtures/dumper/url_matcher1.php

Lines changed: 25 additions & 43 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,10 +51,9 @@ 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-
5857
}
5958

6059
if (0 === strpos($pathinfo, '/test')) {
@@ -73,12 +72,11 @@ public function match($pathinfo)
7372
if ($pathinfo === '/test/baz3/') {
7473
return array('_route' => 'baz3');
7574
}
76-
7775
}
7876

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

8482
// baz5
@@ -88,7 +86,7 @@ public function match($pathinfo)
8886
goto not_baz5;
8987
}
9088

91-
return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz5')), array ());
89+
return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz5')), array());
9290
}
9391
not_baz5:
9492

@@ -99,20 +97,19 @@ public function match($pathinfo)
9997
goto not_bazbaz6;
10098
}
10199

102-
return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz.baz6')), array ());
100+
return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz.baz6')), array());
103101
}
104102
not_bazbaz6:
105-
106103
}
107104

108105
// foofoo
109106
if ($pathinfo === '/foofoo') {
110-
return array ( 'def' => 'test', '_route' => 'foofoo',);
107+
return array('def' => 'test', '_route' => 'foofoo');
111108
}
112109

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

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

130127
// bar1
131128
if (preg_match('#^/a/b\'b/(?P<bar>[^/]++)$#s', $pathinfo, $matches)) {
132-
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar1')), array ());
129+
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar1')), array());
133130
}
134-
135131
}
136132

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

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

148144
// bar2
149145
if (preg_match('#^/a/b\'b/(?P<bar1>[^/]++)$#s', $pathinfo, $matches)) {
150-
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar2')), array ());
146+
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar2')), array());
151147
}
152-
153148
}
154-
155149
}
156150

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

163157
// overridden2
@@ -169,17 +163,16 @@ public function match($pathinfo)
169163
if ($pathinfo === '/multi/hey/') {
170164
return array('_route' => 'hey');
171165
}
172-
173166
}
174167

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

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

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

191184
// foo4
192185
if (preg_match('#^/aba/(?P<foo>[^/]++)$#s', $pathinfo, $matches)) {
193-
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo4')), array ());
186+
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo4')), array());
194187
}
195-
196188
}
197189

198190
$host = $this->context->getHost();
@@ -207,31 +199,27 @@ public function match($pathinfo)
207199
if ($pathinfo === '/c2/route2') {
208200
return array('_route' => 'route2');
209201
}
210-
211202
}
212203

213204
if (preg_match('#^b\\.example\\.com$#si', $host, $hostMatches)) {
214205
// route3
215206
if ($pathinfo === '/c2/route3') {
216207
return array('_route' => 'route3');
217208
}
218-
219209
}
220210

221211
if (preg_match('#^a\\.example\\.com$#si', $host, $hostMatches)) {
222212
// route4
223213
if ($pathinfo === '/route4') {
224214
return array('_route' => 'route4');
225215
}
226-
227216
}
228217

229218
if (preg_match('#^c\\.example\\.com$#si', $host, $hostMatches)) {
230219
// route5
231220
if ($pathinfo === '/route5') {
232221
return array('_route' => 'route5');
233222
}
234-
235223
}
236224

237225
// route6
@@ -243,47 +231,43 @@ public function match($pathinfo)
243231
if (0 === strpos($pathinfo, '/route1')) {
244232
// route11
245233
if ($pathinfo === '/route11') {
246-
return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route11')), array ());
234+
return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route11')), array());
247235
}
248236

249237
// route12
250238
if ($pathinfo === '/route12') {
251-
return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route12')), array ( 'var1' => 'val',));
239+
return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route12')), array('var1' => 'val'));
252240
}
253241

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

259247
// route14
260248
if (0 === strpos($pathinfo, '/route14') && preg_match('#^/route14/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
261-
return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route14')), array ( 'var1' => 'val',));
249+
return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route14')), array('var1' => 'val'));
262250
}
263-
264251
}
265-
266252
}
267253

268254
if (preg_match('#^c\\.example\\.com$#si', $host, $hostMatches)) {
269255
// route15
270256
if (0 === strpos($pathinfo, '/route15') && preg_match('#^/route15/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
271-
return $this->mergeDefaults(array_replace($matches, array('_route' => 'route15')), array ());
257+
return $this->mergeDefaults(array_replace($matches, array('_route' => 'route15')), array());
272258
}
273-
274259
}
275260

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

282267
// route17
283268
if ($pathinfo === '/route17') {
284269
return array('_route' => 'route17');
285270
}
286-
287271
}
288272

289273
if (0 === strpos($pathinfo, '/a')) {
@@ -295,16 +279,14 @@ public function match($pathinfo)
295279
if (0 === strpos($pathinfo, '/a/b')) {
296280
// b
297281
if (preg_match('#^/a/b/(?P<var>[^/]++)$#s', $pathinfo, $matches)) {
298-
return $this->mergeDefaults(array_replace($matches, array('_route' => 'b')), array ());
282+
return $this->mergeDefaults(array_replace($matches, array('_route' => 'b')), array());
299283
}
300284

301285
// c
302286
if (0 === strpos($pathinfo, '/a/b/c') && preg_match('#^/a/b/c/(?P<var>[^/]++)$#s', $pathinfo, $matches)) {
303-
return $this->mergeDefaults(array_replace($matches, array('_route' => 'c')), array ());
287+
return $this->mergeDefaults(array_replace($matches, array('_route' => 'c')), array());
304288
}
305-
306289
}
307-
308290
}
309291

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

0 commit comments

Comments
 (0)