@@ -26,13 +26,13 @@ public function match($pathinfo)
26
26
$ pathinfo = rawurldecode ($ pathinfo );
27
27
28
28
// foo
29
- if (0 === strpos ($ pathinfo , '/foo ' ) && preg_match ('#^/foo/(?<bar>baz|symfony)$#s ' , $ pathinfo , $ matches )) {
29
+ if (0 === strpos ($ pathinfo , '/foo ' ) && preg_match ('#^/foo/(?P <bar>baz|symfony)$#s ' , $ pathinfo , $ matches )) {
30
30
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'foo ' )), array ( 'def ' => 'test ' ,));
31
31
}
32
32
33
33
if (0 === strpos ($ pathinfo , '/bar ' )) {
34
34
// bar
35
- if (preg_match ('#^/bar/(?<foo>[^/]++)$#s ' , $ pathinfo , $ matches )) {
35
+ if (preg_match ('#^/bar/(?P <foo>[^/]++)$#s ' , $ pathinfo , $ matches )) {
36
36
if (!in_array ($ this ->context ->getMethod (), array ('GET ' , 'HEAD ' ))) {
37
37
$ allow = array_merge ($ allow , array ('GET ' , 'HEAD ' ));
38
38
goto not_bar;
@@ -43,7 +43,7 @@ public function match($pathinfo)
43
43
not_bar:
1E79
44
44
45
45
// barhead
46
- if (0 === strpos ($ pathinfo , '/barhead ' ) && preg_match ('#^/barhead/(?<foo>[^/]++)$#s ' , $ pathinfo , $ matches )) {
46
+ if (0 === strpos ($ pathinfo , '/barhead ' ) && preg_match ('#^/barhead/(?P <foo>[^/]++)$#s ' , $ pathinfo , $ matches )) {
47
47
if (!in_array ($ this ->context ->getMethod (), array ('GET ' , 'HEAD ' ))) {
48
48
$ allow = array_merge ($ allow , array ('GET ' , 'HEAD ' ));
49
49
goto not_barhead;
@@ -74,12 +74,12 @@ public function match($pathinfo)
74
74
}
75
75
76
76
// baz4
77
- if (preg_match ('#^/test/(?<foo>[^/]++)/$#s ' , $ pathinfo , $ matches )) {
77
+ if (preg_match ('#^/test/(?P <foo>[^/]++)/$#s ' , $ pathinfo , $ matches )) {
78
78
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'baz4 ' )), array ());
79
79
}
80
80
81
81
// baz5
82
- if (preg_match ('#^/test/(?<foo>[^/]++)/$#s ' , $ pathinfo , $ matches )) {
82
+ if (preg_match ('#^/test/(?P <foo>[^/]++)/$#s ' , $ pathinfo , $ matches )) {
83
83
if ($ this ->context ->getMethod () != 'POST ' ) {
84
84
$ allow [] = 'POST ' ;
85
85
goto not_baz5;
@@ -90,7 +90,7 @@ public function match($pathinfo)
90
90
not_baz5:
91
91
92
92
// baz.baz6
93
- if (preg_match ('#^/test/(?<foo>[^/]++)/$#s ' , $ pathinfo , $ matches )) {
93
+ if (preg_match ('#^/test/(?P <foo>[^/]++)/$#s ' , $ pathinfo , $ matches )) {
94
94
if ($ this ->context ->getMethod () != 'PUT ' ) {
95
95
$ allow [] = 'PUT ' ;
96
96
goto not_bazbaz6;
@@ -108,7 +108,7 @@ public function match($pathinfo)
108
108
}
109
109
110
110
// quoter
111
- if (preg_match ('#^/(?<quoter>[ \']+)$#s ' , $ pathinfo , $ matches )) {
111
+ if (preg_match ('#^/(?P <quoter>[ \']+)$#s ' , $ pathinfo , $ matches )) {
112
112
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'quoter ' )), array ());
113
113
}
114
114
@@ -120,30 +120,30 @@ public function match($pathinfo)
120
120
if (0 === strpos ($ pathinfo , '/a ' )) {
121
121
if (0 === strpos ($ pathinfo , '/a/b \'b ' )) {
122
122
// foo1
123
- if (preg_match ('#^/a/b \'b/(?<foo>[^/]++)$#s ' , $ pathinfo , $ matches )) {
123
+ if (preg_match ('#^/a/b \'b/(?P <foo>[^/]++)$#s ' , $ pathinfo , $ matches )) {
124
124
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route' => 'foo1 ' )), array ());
125
125
}
126
126
127
127
// bar1
128
- if (preg_match ('#^/a/b \'b/(?<bar>[^/]++)$#s ' , $ pathinfo , $ matches )) {
128
+ if (preg_match ('#^/a/b \'b/(?P <bar>[^/]++)$#s ' , $ pathinfo , $ matches )) {
129
129
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'bar1 ' )), array ());
130
130
}
131
131
132
132
}
133
133
134
134
// overridden
135
- if (preg_match ('#^/a/(?<var>.*)$#s ' , $ pathinfo , $ matches )) {
135
+ if (preg_match ('#^/a/(?P <var>.*)$#s ' , $ pathinfo , $ matches )) {
136
136
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'overridden ' )), array ());
137
137
}
138
138
139
139
if (0 === strpos ($ pathinfo , '/a/b \'b ' )) {
140
140
// foo2
141
- if (preg_match ('#^/a/b \'b/(?<foo1>[^/]++)$#s ' , $ pathinfo , $ matches )) {
141
+ if (preg_match ('#^/a/b \'b/(?P <foo1>[^/]++)$#s ' , $ pathinfo , $ matches )) {
142
142
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'foo2 ' )), array ());
143
143
}
144
144
145
145
// bar2
146
- if (preg_match ('#^/a/b \'b/(?<bar1>[^/]++)$#s ' , $ pathinfo , $ matches )) {
146
+ if (preg_match ('#^/a/b \'b/(?P <bar1>[^/]++)$#s ' , $ pathinfo , $ matches )) {
147
147
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'bar2 ' )), array ());
148
148
}
149
149
@@ -153,7 +153,7 @@ public function match($pathinfo)
153
153
154
154
if (0 === strpos ($ pathinfo , '/multi ' )) {
155
155
// helloWorld
156
- if (0 === strpos ($ pathinfo , '/multi/hello ' ) && preg_match ('#^/multi/hello(?:/(?<who>[^/]++))?$#s ' , $ pathinfo , $ matches )) {
156
+ if (0 === strpos ($ pathinfo , '/multi/hello ' ) && preg_match ('#^/multi/hello(?:/(?P <who>[^/]++))?$#s ' , $ pathinfo , $ matches )) {
157
157
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'helloWorld ' )), array ( 'who ' => 'World! ' ,));
158
158
}
159
159
@@ -170,12 +170,12 @@ public function match($pathinfo)
170
170
}
171
171
172
172
// foo3
173
- if (preg_match ('#^/(?<_locale>[^/]++)/b/(?<foo>[^/]++)$#s ' , $ pathinfo , $ matches )) {
173
+ if (preg_match ('#^/(?P <_locale>[^/]++)/b/(?P <foo>[^/]++)$#s ' , $ pathinfo , $ matches )) {
174
174
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'foo3 ' )), array ());
175
175
}
176
176
177
177
// bar3
178
- if (preg_match ('#^/(?<_locale>[^/]++)/b/(?<bar>[^/]++)$#s ' , $ pathinfo , $ matches )) {
178
+ if (preg_match ('#^/(?P <_locale>[^/]++)/b/(?P <bar>[^/]++)$#s ' , $ pathinfo , $ matches )) {
179
179
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'bar3 ' )), array ());
180
180
}
181
181
@@ -186,7 +186,7 @@ public function match($pathinfo)
186
186
}
187
187
188
188
// foo4
189
- if (preg_match ('#^/aba/(?<foo>[^/]++)$#s ' , $ pathinfo , $ matches )) {
189
+ if (preg_match ('#^/aba/(?P <foo>[^/]++)$#s ' , $ pathinfo , $ matches )) {
190
190
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'foo4 ' )), array ());
191
191
}
192
192
@@ -236,7 +236,7 @@ public function match($pathinfo)
236
236
return array ('_route ' => 'route6 ' );
237
237
}
238
238
239
- if (preg_match ('#^(?<var1>[^ \\.]++) \\.example \\.com$#s ' , $ hostname , $ hostnameMatches )) {
239
+ if (preg_match ('#^(?P <var1>[^ \\.]++) \\.example \\.com$#s ' , $ hostname , $ hostnameMatches )) {
240
240
if (0 === strpos ($ pathinfo , '/route1 ' )) {
241
241
// route11
242
242
if ($ pathinfo === '/route11 ' ) {
@@ -249,12 +249,12 @@ public function match($pathinfo)
249
249
}
250
250
251
251
// route13
252
- if (0 === strpos ($ pathinfo , '/route13 ' ) && preg_match ('#^/route13/(?<name>[^/]++)$#s ' , $ pathinfo , $ matches )) {
252
+ if (0 === strpos ($ pathinfo , '/route13 ' ) && preg_match ('#^/route13/(?P <name>[^/]++)$#s ' , $ pathinfo , $ matches )) {
253
253
return $ this ->mergeDefaults (array_replace ($ hostnameMatches , $ matches , array ('_route ' => 'route13 ' )), array ());
254
254
}
255
255
256
256
// route14
257
- if (0 === strpos ($ pathinfo , '/route14 ' ) && preg_match ('#^/route14/(?<name>[^/]++)$#s ' , $ pathinfo , $ matches )) {
257
+ if (0 === strpos ($ pathinfo , '/route14 ' ) && preg_match ('#^/route14/(?P <name>[^/]++)$#s ' , $ pathinfo , $ matches )) {
258
258
return $ this ->mergeDefaults (array_replace ($ hostnameMatches , $ matches , array ('_route ' => 'route14 ' )), array ( 'var1 ' => 'val ' ,));
259
259
}
260
260
@@ -264,15 +264,15 @@ public function match($pathinfo)
264
7802
264
265
265
if (preg_match ('#^c \\.example \\.com$#s ' , $ hostname , $ hostnameMatches )) {
266
266
// route15
267
- if (0 === strpos ($ pathinfo , '/route15 ' ) && preg_match ('#^/route15/(?<name>[^/]++)$#s ' , $ pathinfo , $ matches )) {
267
+ if (0 === strpos ($ pathinfo , '/route15 ' ) && preg_match ('#^/route15/(?P <name>[^/]++)$#s ' , $ pathinfo , $ matches )) {
268
268
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'route15 ' )), array ());
269
269
}
270
270
271
271
}
272
272
273
273
if (0 === strpos ($ pathinfo , '/route1 ' )) {
274
274
// route16
275
- if (0 === strpos ($ pathinfo , '/route16 ' ) && preg_match ('#^/route16/(?<name>[^/]++)$#s ' , $ pathinfo , $ matches )) {
275
+ if (0 === strpos ($ pathinfo , '/route16 ' ) && preg_match ('#^/route16/(?P <name>[^/]++)$#s ' , $ pathinfo , $ matches )) {
276
276
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'route16 ' )), array ( 'var1 ' => 'val ' ,));
277
277
}
278
278
@@ -291,12 +291,12 @@ public function match($pathinfo)
291
291
292
292
if (0 === strpos ($ pathinfo , '/a/b ' )) {
293
293
// b
294
- if (preg_match ('#^/a/b/(?<var>[^/]++)$#s ' , $ pathinfo , $ matches )) {
294
+ if (preg_match ('#^/a/b/(?P <var>[^/]++)$#s ' , $ pathinfo , $ matches )) {
295
295
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'b ' )), array ());
296
296
}
297
297
298
298
// c
299
- if (0 === strpos ($ pathinfo , '/a/b/c ' ) && preg_match ('#^/a/b/c/(?<var>[^/]++)$#s ' , $ pathinfo , $ matches )) {
299
+ if (0 === strpos ($ pathinfo , '/a/b/c ' ) && preg_match ('#^/a/b/c/(?P <var>[^/]++)$#s ' , $ pathinfo , $ matches )) {
300
300
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'c ' )), array ());
301
301
}
302
302
0 commit comments