@@ -26,12 +26,12 @@ 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 array_merge ($ this ->mergeDefaults ($ matches , array ( 'def ' => 'test ' ,)), array ('_route ' => 'foo ' ));
31
31
}
32
32
33
33
// bar
34
- if (0 === strpos ($ pathinfo , '/bar ' ) && preg_match ('#^/bar/(?<foo>[^/]+)$#s ' , $ pathinfo , $ matches )) {
34
+ if (0 === strpos ($ pathinfo , '/bar ' ) && preg_match ('#^/bar/(?P <foo>[^/]+)$#s ' , $ pathinfo , $ matches )) {
35
35
if (!in_array ($ this ->context ->getMethod (), array ('GET ' , 'HEAD ' ))) {
36
36
$ allow = array_merge ($ allow , array ('GET ' , 'HEAD ' ));
37
37
goto not_bar;
@@ -44,7 +44,7 @@ public function match($pathinfo)
44
44
not_bar:
45
45
46
46
// barhead
47
- if (0 === strpos ($ pathinfo , '/barhead ' ) && preg_match ('#^/barhead/(?<foo>[^/]+)$#s ' , $ pathinfo , $ matches )) {
47
+ if (0 === strpos ($ pathinfo , '/barhead ' ) && preg_match ('#^/barhead/(?P <foo>[^/]+)$#s ' , $ pathinfo , $ matches )) {
48
48
if (!in_array ($ this ->context ->getMethod (), array ('GET ' , 'HEAD ' ))) {
49
49
$ allow = array_merge ($ allow , array ('GET ' , 'HEAD ' ));
50
50
goto not_barhead;
@@ -76,7 +76,7 @@ public function match($pathinfo)
76
76
}
77
77
78
78
// baz4
79
- if (0 === strpos ($ pathinfo , '/test ' ) && preg_match ('#^/test/(?<foo>[^/]+)/?$#s ' , $ pathinfo , $ matches )) {
79
+ if (0 === strpos ($ pathinfo , '/test ' ) && preg_match ('#^/test/(?P <foo>[^/]+)/?$#s ' , $ pathinfo , $ matches )) {
80
80
if (substr ($ pathinfo , -1 ) !== '/ ' ) {
81
81
return $ this ->redirect ($ pathinfo .'/ ' , 'baz4 ' );
82
82
}
@@ -87,7 +87,7 @@ public function match($pathinfo)
87
87
}
88
88
89
89
// baz5
90
- if (0 === strpos ($ pathinfo , '/test ' ) && preg_match ('#^/test/(?<foo>[^/]+)/$#s ' , $ pathinfo , $ matches )) {
90
+ if (0 === strpos ($ pathinfo , '/test ' ) && preg_match ('#^/test/(?P <foo>[^/]+)/$#s ' , $ pathinfo , $ matches )) {
91
91
if ($ this ->context ->getMethod () != 'POST ' ) {
92
92
$ allow [] = 'POST ' ;
93
93
goto not_baz5;
@@ -100,7 +100,7 @@ public function match($pathinfo)
100
100
not_baz5:
101
101
102
102
// baz.baz6
103
- if (0 === strpos ($ pathinfo , '/test ' ) && preg_match ('#^/test/(?<foo>[^/]+)/$#s ' , $ pathinfo , $ matches )) {
103
+ if (0 === strpos ($ pathinfo , '/test ' ) && preg_match ('#^/test/(?P <foo>[^/]+)/$#s ' , $ pathinfo , $ matches )) {
104
104
if ($ this ->context ->getMethod () != 'PUT ' ) {
105
105
$ allow [] = 'PUT ' ;
106
106
goto not_bazbaz6;
@@ -118,7 +118,7 @@ public function match($pathinfo)
118
118
}
119
119
120
120
// quoter
121
- if (preg_match ('#^/(?<quoter>[ \']+)$#s ' , $ pathinfo , $ matches )) {
121
+ if (preg_match ('#^/(?P <quoter>[ \']+)$#s ' , $ pathinfo , $ matches )) {
122
122
$ matches ['_route ' ] = 'quoter ' ;
123
123
124
124
return $ matches ;
@@ -132,14 +132,14 @@ public function match($pathinfo)
132
132
if (0 === strpos ($ pathinfo , '/a ' )) {
133
133
if (0 === strpos ($ pathinfo , '/a/b \'b ' )) {
134
134
// foo1
135
- if (preg_match ('#^/a/b \'b/(?<foo>[^/]+)$#s ' , $ pathinfo , $ matches )) {
135
+ if (preg_match ('#^/a/b \'b/(?P <foo>[^/]+)$#s ' , $ pathinfo , <
10000
span class="pl-s1">$ matches)) {
136
136
$ matches ['_route ' ] = 'foo1 ' ;
137
137
138
138
return $ matches ;
139
139
}
140
140
141
141
// bar1
142
- if (preg_match ('#^/a/b \'b/(?<bar>[^/]+)$#s ' , $ pathinfo , $ matches )) {
142
+ if (preg_match ('#^/a/b \'b/(?P <bar>[^/]+)$#s ' , $ pathinfo , $ matches )) {
143
143
$ matches ['_route ' ] = 'bar1 ' ;
144
144
145
145
return $ matches ;
@@ -148,22 +148,22 @@ public function match($pathinfo)
148
148
}
149
149
150
150
// overridden
151
- if (preg_match ('#^/a/(?<var>.*)$#s ' , $ pathinfo , $ matches )) {
151
+ if (preg_match ('#^/a/(?P <var>.*)$#s ' , $ pathinfo , $ matches )) {
152
152
$ matches ['_route ' ] = 'overridden ' ;
153
153
154
154
return $ matches ;
155
155
}
156
156
157
157
if (0 === strpos ($ pathinfo , '/a/b \'b ' )) {
158
158
// foo2
159
- if (preg_match ('#^/a/b \'b/(?<foo1>[^/]+)$#s ' , $ pathinfo , $ matches )) {
159
+ if (preg_match ('#^/a/b \'b/(?P <foo1>[^/]+)$#s ' , $ pathinfo , $ matches )) {
160
160
$ matches ['_route ' ] = 'foo2 ' ;
161
161
162
162
return $ matches ;
163
163
}
164
164
165
165
// bar2
166
- if (preg_match ('#^/a/b \'b/(?<bar1>[^/]+)$#s ' , $ pathinfo , $ matches )) {
166
+ if (preg_match ('#^/a/b \'b/(?P <bar1>[^/]+)$#s ' , $ pathinfo , $ matches )) {
167
167
$ matches ['_route ' ] = 'bar2 ' ;
168
168
169
169
return $ matches ;
@@ -175,7 +175,7 @@ public function match($pathinfo)
175
175
176
176
if (0 === strpos ($ pathinfo , '/multi ' )) {
177
177
// helloWorld
178
- if (0 === strpos ($ pathinfo , '/multi/hello ' ) && preg_match ('#^/multi/hello(?:/(?<who>[^/]+))?$#s ' , $ pathinfo , $ matches )) {
178
+ if (0 === strpos ($ pathinfo , '/multi/hello ' ) && preg_match ('#^/multi/hello(?:/(?P <who>[^/]+))?$#s ' , $ pathinfo , $ matches )) {
179
179
return array_merge ($ this ->mergeDefaults ($ matches , array ( 'who ' => 'World! ' ,)), array ('_route ' => 'helloWorld ' ));
180
180
}
181
181
@@ -196,14 +196,14 @@ public function match($pathinfo)
196
196
}
197
197
198
198
// foo3
199
- if (preg_match ('#^/(?<_locale>[^/]+)/b/(?<foo>[^/]+)$#s ' , $ pathinfo , $ matches )) {
199
+ if (preg_match ('#^/(?P <_locale>[^/]+)/b/(?P <foo>[^/]+)$#s ' , $ pathinfo , $ matches )) {
200
200
$ matches ['_route ' ] = 'foo3 ' ;
201
201
202
202
return $ matches ;
203
203
}
204
204
205
205
// bar3
206
- if (preg_match ('#^/(?<_locale>[^/]+)/b/(?<bar>[^/]+)$#s ' , $ pathinfo , $ matches )) {
206
+ if (preg_match ('#^/(?P <_locale>[^/]+)/b/(?P <bar>[^/]+)$#s ' , $ pathinfo , $ matches )) {
207
207
$ matches ['_route ' ] = 'bar3 ' ;
208
208
209
209
return $ matches ;
@@ -215,7 +215,7 @@ public function match($pathinfo)
215
215
}
216
216
217
217
// foo4
218
- if (0 === strpos ($ pathinfo , '/aba ' ) && preg_match ('#^/aba/(?<foo>[^/]+)$#s ' , $ pathinfo , $ matches )) {
218
+ if (0 === strpos ($ pathinfo , '/aba ' ) && preg_match ('#^/aba/(?P <foo>[^/]+)$#s ' , $ pathinfo , $ matches )) {
219
219
$ matches ['_route ' ] = 'foo4 ' ;
220
220
221
221
return $ matches ;
@@ -229,14 +229,14 @@ public function match($pathinfo)
229
229
230
230
if (0 === strpos ($ pathinfo , '/a/b ' )) {
231
231
// b
232
- if (preg_match ('#^/a/b/(?<var>[^/]+)$#s ' , $ pathinfo , $ matches )) {
232
+ if (preg_match ('#^/a/b/(?P <var>[^/]+)$#s ' , $ pathinfo , $ matches )) {
233
233
$ matches ['_route ' ] = 'b ' ;
234
234
235
235
return $ matches ;
236
236
}
237
237
238
238
// c
239
- if (0 === strpos ($ pathinfo , '/a/b/c ' ) && preg_match ('#^/a/b/c/(?<var>[^/]+)$#s ' , $ pathinfo , $ matches )) {
239
+ if (0 === strpos ($ pathinfo , '/a/b/c ' ) && preg_match ('#^/a/b/c/(?P <var>[^/]+)$#s ' , $ pathinfo , $ matches )) {
240
240
$ matches ['_route ' ] = 'c ' ;
241
241
242
242
return $ matches ;
0 commit comments