Skip to content

Commit e60e0e4

Browse files
Merge branch '3.4' into 4.0
* 3.4: Use the PCRE_DOLLAR_ENDONLY modifier in route regexes [Form] Make sure errors are a part of the label on bootstrap 4 - this is a requirement for WCAG2 [Config] Only using filemtime to check file freshness
2 parents 7756eac + f18db32 commit e60e0e4

File tree

12 files changed

+81
-72
lines changed

12 files changed

+81
-72
lines changed

Tests/Console/Descriptor/ObjectsProvider.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use Symfony\Component\DependencyInjection\Reference;
2020
use Symfony\Component\EventDispatcher\EventDispatcher;
2121
use Symfony\Component\Routing\Route;
22+
use Symfony\Component\Routing\CompiledRoute;
2223
use Symfony\Component\Routing\RouteCollection;
2324

2425
class ObjectsProvider
@@ -36,7 +37,7 @@ public static function getRouteCollections()
3637
public static function getRoutes()
3738
{
3839
return array(
39-
'route_1' => new Route(
40+
'route_1' => new RouteStub(
4041
'/hello/{name}',
4142
array('name' => 'Joseph'),
4243
array('name' => '[a-z]+'),
@@ -45,7 +46,7 @@ public static function getRoutes()
4546
array('http', 'https'),
4647
array('get', 'head')
4748
),
48-
'route_2' => new Route(
49+
'route_2' => new RouteStub(
4950
'/name/add',
5051
array(),
5152
array(),
@@ -187,3 +188,11 @@ public static function staticMethod()
187188
{
188189
}
189190
}
191+
192+
class RouteStub extends Route
193+
{
194+
public function compile()
195+
{
196+
return new CompiledRoute('', '#PATH_REGEX#', array(), array(), '#HOST_REGEX#');
197+
}
198+
}

Tests/Fixtures/Descriptor/route_1.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"path": "\/hello\/{name}",
3-
"pathRegex": "#^\/hello(?:\/(?P<name>[a-z]+))?$#s",
3+
"pathRegex": "#PATH_REGEX#",
44
"host": "localhost",
5-
"hostRegex": "#^localhost$#si",
5+
"hostRegex": "#HOST_REGEX#",
66
"scheme": "http|https",
77
"method": "GET|HEAD",
8-
"class": "Symfony\\Component\\Routing\\Route",
8+
"class": "Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\RouteStub",
99
"defaults": {
1010
"name": "Joseph"
1111
},

Tests/Fixtures/Descriptor/route_1.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
- Path: /hello/{name}
2-
- Path Regex: #^/hello(?:/(?P<name>[a-z]+))?$#s
2+
- Path Regex: #PATH_REGEX#
33
- Host: localhost
4-
- Host Regex: #^localhost$#si
4+
- Host Regex: #HOST_REGEX#
55
- Scheme: http|https
66
- Method: GET|HEAD
7-
- Class: Symfony\Component\Routing\Route
7+
- Class: Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\RouteStub
88
- Defaults:
99
- `name`: Joseph
1010
- Requirements:

Tests/Fixtures/Descriptor/route_1.txt

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
+--------------+---------------------------------------------------------+
2-
| Property | Value |
3-
+--------------+---------------------------------------------------------+
4-
| Route Name | |
5-
| Path | /hello/{name} |
6-
| Path Regex | #^/hello(?:/(?P<name>[a-z]+))?$#s |
7-
| Host | localhost |
8-
| Host Regex | #^localhost$#si |
9-
| Scheme | http|https |
10-
| Method | GET|HEAD |
11-
| Requirements | name: [a-z]+ |
12-
| Class | Symfony\Component\Routing\Route |
13-
| Defaults | name: Joseph |
14-
| Options | compiler_class: Symfony\Component\Routing\RouteCompiler |
15-
| | opt1: val1 |
16-
| | opt2: val2 |
17-
+--------------+---------------------------------------------------------+
1+
+--------------+-------------------------------------------------------------------+
2+
| Property | Value |
3+
+--------------+-------------------------------------------------------------------+
4+
| Route Name | |
5+
| Path | /hello/{name} |
6+
| Path Regex | #PATH_REGEX# |
7+
| Host | localhost |
8+
| Host Regex | #HOST_REGEX# |
9+
| Scheme | http|https |
10+
| Method | GET|HEAD |
11+
| Requirements | name: [a-z]+ |
12+
| Class | Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\RouteStub |
13+
| Defaults | name: Joseph |
14+
| Options | compiler_class: Symfony\Component\Routing\RouteCompiler |
15+
| | opt1: val1 |
16+
| | opt2: val2 |
17+
+--------------+-------------------------------------------------------------------+

Tests/Fixtures/Descriptor/route_1.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<route class="Symfony\Component\Routing\Route">
3-
<path regex="#^/hello(?:/(?P&lt;name&gt;[a-z]+))?$#s">/hello/{name}</path>
4-
<host regex="#^localhost$#si">localhost</host>
2+
<route class="Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\RouteStub">
3+
<path regex="#PATH_REGEX#">/hello/{name}</path>
4+
<host regex="#HOST_REGEX#">localhost</host>
55
<scheme>http</scheme>
66
<scheme>https</scheme>
77
<method>GET</method>

Tests/Fixtures/Descriptor/route_2.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"path": "\/name\/add",
3-
"pathRegex": "#^\/name\/add$#s",
3+
"pathRegex": "#PATH_REGEX#",
44
"host": "localhost",
5-
"hostRegex": "#^localhost$#si",
5+
"hostRegex": "#HOST_REGEX#",
66
"scheme": "http|https",
77
"method": "PUT|POST",
8-
"class": "Symfony\\Component\\Routing\\Route",
8+
"class": "Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\RouteStub",
99
"defaults": [],
1010
"requirements": "NO CUSTOM",
1111
"options": {

Tests/Fixtures/Descriptor/route_2.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
- Path: /name/add
2-
- Path Regex: #^/name/add$#s
2+
- Path Regex: #PATH_REGEX#
33
- Host: localhost
4-
- Host Regex: #^localhost$#si
4+
- Host Regex: #HOST_REGEX#
55
- Scheme: http|https
66
- Method: PUT|POST
7-
- Class: Symfony\Component\Routing\Route
7+
- Class: Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\RouteStub
88
- Defaults: NONE
99
- Requirements: NO CUSTOM
1010
- Options:

Tests/Fixtures/Descriptor/route_2.txt

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
+--------------+---------------------------------------------------------+
2-
| Property | Value |
3-
+--------------+---------------------------------------------------------+
4-
| Route Name | |
5-
| Path | /name/add |
6-
| Path Regex | #^/name/add$#s |
7-
| Host | localhost |
8-
| Host Regex | #^localhost$#si |
9-
| Scheme | http|https |
10-
| Method | PUT|POST |
11-
| Requirements | NO CUSTOM |
12-
| Class | Symfony\Component\Routing\Route |
13-
| Defaults | NONE |
14-
| Options | compiler_class: Symfony\Component\Routing\RouteCompiler |
15-
| | opt1: val1 |
16-
| | opt2: val2 |
17-
+--------------+---------------------------------------------------------+
1+
+--------------+-------------------------------------------------------------------+
2+
| Property | Value |
3+
+--------------+-------------------------------------------------------------------+
4+
| Route Name | |
5+
| Path | /name/add |
6+
| Path Regex | #PATH_REGEX# |
7+
| Host | localhost |
8+
| Host Regex | #HOST_REGEX# |
9+
| Scheme | http|https |
10+
| Method | PUT|POST |
11+
| Requirements | NO CUSTOM |
12+
| Class | Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\RouteStub |
13+
| Defaults | NONE |
14+
| Options | compiler_class: Symfony\Component\Routing\RouteCompiler |
15+
| | opt1: val1 |
16+
| | opt2: val2 |
17+
+--------------+-------------------------------------------------------------------+

Tests/Fixtures/Descriptor/route_2.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<route class="Symfony\Component\Routing\Route">
3-
<path regex="#^/name/add$#s">/name/add</path>
4-
<host regex="#^localhost$#si">localhost</host>
2+
<route class="Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\RouteStub">
3+
<path regex="#PATH_REGEX#">/name/add</path>
4+
<host regex="#HOST_REGEX#">localhost</host>
55
<scheme>http</scheme>
66
<scheme>https</scheme>
77
<method>PUT</method>

Tests/Fixtures/Descriptor/route_collection_1.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"route_1": {
33
"path": "\/hello\/{name}",
4-
"pathRegex": "#^\/hello(?:\/(?P<name>[a-z]+))?$#s",
4+
"pathRegex": "#PATH_REGEX#",
55
"host": "localhost",
6-
"hostRegex": "#^localhost$#si",
6+
"hostRegex": "#HOST_REGEX#",
77
"scheme": "http|https",
88
"method": "GET|HEAD",
9-
"class": "Symfony\\Component\\Routing\\Route",
9+
"class": "Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\RouteStub",
1010
"defaults": {
1111
"name": "Joseph"
1212
},
@@ -21,12 +21,12 @@
2121
},
2222
"route_2": {
2323
"path": "\/name\/add",
24-
"pathRegex": "#^\/name\/add$#s",
24+
"pathRegex": "#PATH_REGEX#",
2525
"host": "localhost",
26-
"hostRegex": "#^localhost$#si",
26+
"hostRegex": "#HOST_REGEX#",
2727
"scheme": "http|https",
2828
"method": "PUT|POST",
29-
"class": "Symfony\\Component\\Routing\\Route",
29+
"class": "Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\RouteStub",
3030
"defaults": [],
3131
"requirements": "NO CUSTOM",
3232
"options": {

0 commit comments

Comments
 (0)