From 530af5c009337d774e9c2416df69eb4648fc574f Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 7 Jan 2015 18:41:40 +0100 Subject: [PATCH] [FrameworkBundle] fixed missing information in some descriptors --- .../Console/Descriptor/JsonDescriptor.php | 18 ++++++++++++- .../Console/Descriptor/MarkdownDescriptor.php | 22 ++++++++++++--- .../Console/Descriptor/TextDescriptor.php | 27 ++++++++++++++----- .../Fixtures/Descriptor/builder_1_public.json | 5 ++++ .../Fixtures/Descriptor/builder_1_public.md | 5 ++++ .../Descriptor/builder_1_services.json | 10 +++++++ .../Fixtures/Descriptor/builder_1_services.md | 10 +++++++ .../Fixtures/Descriptor/builder_1_tag1.json | 5 ++++ .../Fixtures/Descriptor/builder_1_tag1.md | 5 ++++ .../Fixtures/Descriptor/builder_1_tags.json | 14 ++++++++-- .../Fixtures/Descriptor/builder_1_tags.md | 10 +++++++ .../Fixtures/Descriptor/definition_1.json | 5 ++++ .../Tests/Fixtures/Descriptor/definition_1.md | 5 ++++ .../Fixtures/Descriptor/definition_1.txt | 6 ++++- .../Fixtures/Descriptor/definition_2.json | 5 ++++ .../Tests/Fixtures/Descriptor/definition_2.md | 5 ++++ .../Fixtures/Descriptor/definition_2.txt | 5 ++++ .../Tests/Fixtures/Descriptor/route_1.json | 5 ++-- .../Tests/Fixtures/Descriptor/route_1.md | 2 ++ .../Tests/Fixtures/Descriptor/route_1.txt | 6 ++--- .../Tests/Fixtures/Descriptor/route_2.json | 5 ++-- .../Tests/Fixtures/Descriptor/route_2.md | 2 ++ .../Tests/Fixtures/Descriptor/route_2.txt | 6 ++--- .../Descriptor/route_collection_1.json | 10 ++++--- .../Fixtures/Descriptor/route_collection_1.md | 4 +++ 25 files changed, 175 insertions(+), 27 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php index 7748143702fb..f8b8ac652e5e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php @@ -169,14 +169,15 @@ protected function getRouteData(Route $route) return array( 'path' => $route->getPath(), + 'pathRegex' => $route->compile()->getRegex(), 'host' => '' !== $route->getHost() ? $route->getHost() : 'ANY', + 'hostRegex' => '' !== $route->getHost() ? $route->compile()->getHostRegex() : '', 'scheme' => $route->getSchemes() ? implode('|', $route->getSchemes()) : 'ANY', 'method' => $route->getMethods() ? implode('|', $route->getMethods()) : 'ANY', 'class' => get_class($route), 'defaults' => $route->getDefaults(), 'requirements' => $requirements ?: 'NO CUSTOM', 'options' => $route->getOptions(), - 'pathRegex' => $route->compile()->getRegex(), ); } @@ -193,9 +194,24 @@ private function getContainerDefinitionData(Definition $definition, $omitTags = 'scope' => $definition->getScope(), 'public' => $definition->isPublic(), 'synthetic' => $definition->isSynthetic(), + 'lazy' => $definition->isLazy(), + 'synchronized' => $definition->isSynchronized(), + 'abstract' => $definition->isSynchronized(), 'file' => $definition->getFile(), ); + if ($definition->getFactoryClass()) { + $data['factory_class'] = $definition->getFactoryClass(); + } + + if ($definition->getFactoryService()) { + $data['factory_service'] = $definition->getFactoryService(); + } + + if ($definition->getFactoryMethod()) { + $data['factory_method'] = $definition->getFactoryMethod(); + } + if (!$omitTags) { $data['tags'] = array(); if (count($definition->getTags())) { diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php index b0cfad0cc5ae..2b4b7d70c97a 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php @@ -49,14 +49,15 @@ protected function describeRoute(Route $route, array $options = array()) unset($requirements['_scheme'], $requirements['_method']); $output = '- Path: '.$route->getPath() + ."\n".'- Path Regex: '.$route->compile()->getRegex() ."\n".'- Host: '.('' !== $route->getHost() ? $route->getHost() : 'ANY') + ."\n".'- Host Regex: '.('' !== $route->getHost() ? $route->compile()->getHostRegex() : '') ."\n".'- Scheme: '.($route->getSchemes() ? implode('|', $route->getSchemes()) : 'ANY') ."\n".'- Method: '.($route->getMethods() ? implode('|', $route->getMethods()) : 'ANY') ."\n".'- Class: '.get_class($route) ."\n".'- Defaults: '.$this->formatRouterConfig($route->getDefaults()) ."\n".'- Requirements: '.$this->formatRouterConfig($requirements) ?: 'NONE' - ."\n".'- Options: '.$this->formatRouterConfig($route->getOptions()) - ."\n".'- Path-Regex: '.$route->compile()->getRegex(); + ."\n".'- Options: '.$this->formatRouterConfig($route->getOptions()); $this->write(isset($options['name']) ? $options['name']."\n".str_repeat('-', strlen($options['name']))."\n\n".$output @@ -176,12 +177,27 @@ protected function describeContainerDefinition(Definition $definition, array $op $output = '- Class: `'.$definition->getClass().'`' ."\n".'- Scope: `'.$definition->getScope().'`' ."\n".'- Public: '.($definition->isPublic() ? 'yes' : 'no') - ."\n".'- Synthetic: '.($definition->isSynthetic() ? 'yes' : 'no'); + ."\n".'- Synthetic: '.($definition->isSynthetic() ? 'yes' : 'no') + ."\n".'- Lazy: '.($definition->isLazy() ? 'yes' : 'no') + ."\n".'- Synchronized: '.($definition->isSynchronized() ? 'yes' : 'no') + ."\n".'- Abstract: '.($definition->isAbstract() ? 'yes' : 'no'); if ($definition->getFile()) { $output .= "\n".'- File: `'.$definition->getFile().'`'; } + if ($definition->getFactoryClass()) { + $output .= "\n".'- Factory Class: `'.$definition->getFactoryClass().'`'; + } + + if ($definition->getFactoryService()) { + $output .= "\n".'- Factory Service: `'.$definition->getFactoryService().'`'; + } + + if ($definition->getFactoryMethod()) { + $output .= "\n".'- Factory Method: `'.$definition->getFactoryMethod().'`'; + } + if (!(isset($options['omit_tags']) && $options['omit_tags'])) { foreach ($definition->getTags() as $tagName => $tagData) { foreach ($tagData as $parameters) { diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php index 3daa77f0ae22..fb506deff903 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php @@ -72,14 +72,15 @@ protected function describeRoute(Route $route, array $options = array()) // fixme: values were originally written as raw $description = array( 'Path '.$route->getPath(), + 'Path Regex '.$route->compile()->getRegex(), 'Host '.('' !== $route->getHost() ? $route->getHost() : 'ANY'), + 'Host Regex '.('' !== $route->getHost() ? $route->compile()->getHostRegex() : ''), 'Scheme '.($route->getSchemes() ? implode('|', $route->getSchemes()) : 'ANY'), 'Method '.($route->getMethods() ? implode('|', $route->getMethods()) : 'ANY'), 'Class '.get_class($route), 'Defaults '.$this->formatRouterConfig($route->getDefaults()), 'Requirements '.$this->formatRouterConfig($requirements) ?: 'NO CUSTOM', 'Options '.$this->formatRouterConfig($route->getOptions()), - 'Path-Regex '.$route->compile()->getRegex(), ); if (isset($options['name'])) { @@ -87,10 +88,6 @@ protected function describeRoute(Route $route, array $options = array()) array_unshift($description, $this->formatSection('router', sprintf('Route "%s"', $options['name']))); } - if (null !== $route->compile()->getHostRegex()) { - $description[] = 'Host-Regex '.$route->compile()->getHostRegex(); - } - $this->writeText(implode("\n", $description)."\n", $options); } @@ -263,7 +260,25 @@ protected function describeContainerDefinition(Definition $definition, array $op $description[] = sprintf('Scope %s', $definition->getScope()); $description[] = sprintf('Public %s', $definition->isPublic() ? 'yes' : 'no'); $description[] = sprintf('Synthetic %s', $definition->isSynthetic() ? 'yes' : 'no'); - $description[] = sprintf('Required File %s', $definition->getFile() ? $definition->getFile() : '-'); + $description[] = sprintf('Lazy %s', $definition->isLazy() ? 'yes' : 'no'); + $description[] = sprintf('Synchronized %s', $definition->isSynchronized() ? 'yes' : 'no'); + $description[] = sprintf('Abstract %s', $definition->isAbstract() ? 'yes' : 'no'); + + if ($definition->getFile()) { + $description[] = sprintf('Required File %s', $definition->getFile() ? $definition->getFile() : '-'); + } + + if ($definition->getFactoryClass()) { + $description[] = sprintf('Factory Class %s', $definition->getFactoryClass()); + } + + if ($definition->getFactoryService()) { + $description[] = sprintf('Factory Service %s', $definition->getFactoryService()); + } + + if ($definition->getFactoryMethod()) { + $description[] = sprintf('Factory Method %s', $definition->getFactoryMethod()); + } $this->writeText(implode("\n", $description)."\n", $options); } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.json b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.json index 33c5ed71d422..16b5eeed2f9e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.json +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.json @@ -5,7 +5,12 @@ "scope": "container", "public": true, "synthetic": false, + "lazy": true, + "synchronized": true, + "abstract": true, "file": null, + "factory_class": "Full\\Qualified\\FactoryClass", + "factory_method": "get", "tags": [ ] diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.md index 196757b13b7a..c80b367c155a 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.md +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.md @@ -11,6 +11,11 @@ definition_1 - Scope: `container` - Public: yes - Synthetic: no +- Lazy: yes +- Synchronized: yes +- Abstract: yes +- Factory Class: `Full\Qualified\FactoryClass` +- Factory Method: `get` Aliases diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.json b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.json index 6dd5929838f1..580e0c38b222 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.json +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.json @@ -5,7 +5,12 @@ "scope": "container", "public": true, "synthetic": false, + "lazy": true, + "synchronized": true, + "abstract": true, "file": null, + "factory_class": "Full\\Qualified\\FactoryClass", + "factory_method": "get", "tags": [ ] @@ -15,7 +20,12 @@ "scope": "container", "public": false, "synthetic": true, + "lazy": false, + "synchronized": false, + "abstract": false, "file": "\/path\/to\/file", + "factory_service": "factory.service", + "factory_method": "get", "tags": [ { "name": "tag1", diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.md index 33cb0a93a74c..0661d7deab85 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.md +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.md @@ -11,6 +11,11 @@ definition_1 - Scope: `container` - Public: yes - Synthetic: no +- Lazy: yes +- Synchronized: yes +- Abstract: yes +- Factory Class: `Full\Qualified\FactoryClass` +- Factory Method: `get` definition_2 ~~~~~~~~~~~~ @@ -19,7 +24,12 @@ definition_2 - Scope: `container` - Public: no - Synthetic: yes +- Lazy: no +- Synchronized: no +- Abstract: no - File: `/path/to/file` +- Factory Service: `factory.service` +- Factory Method: `get` - Tag: `tag1` - Attr1: val1 - Attr2: val2 diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.json b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.json index d9a351b90b1e..53bf114e81e0 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.json +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.json @@ -5,7 +5,12 @@ "scope": "container", "public": false, "synthetic": true, + "lazy": false, + "synchronized": false, + "abstract": false, "file": "\/path\/to\/file", + "factory_service": "factory.service", + "factory_method": "get", "tags": [ { "name": "tag1", diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.md index 2b32f9e84316..56a2c390779a 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.md +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.md @@ -11,7 +11,12 @@ definition_2 - Scope: `container` - Public: no - Synthetic: yes +- Lazy: no +- Synchronized: no +- Abstract: no - File: `/path/to/file` +- Factory Service: `factory.service` +- Factory Method: `get` - Tag: `tag1` - Attr1: val1 - Attr2: val2 diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.json b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.json index e0a3c0f31ca7..3837b95cb89e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.json +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.json @@ -5,7 +5,12 @@ "scope": "container", "public": false, "synthetic": true, - "file": "\/path\/to\/file" + "lazy": false, + "synchronized": false, + "abstract": false, + "file": "\/path\/to\/file", + "factory_service": "factory.service", + "factory_method": "get" } ], "tag2": [ @@ -14,7 +19,12 @@ "scope": "container", "public": false, "synthetic": true, - "file": "\/path\/to\/file" + "lazy": false, + "synchronized": false, + "abstract": false, + "file": "\/path\/to\/file", + "factory_service": "factory.service", + "factory_method": "get" } ] } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.md index b69cf69ac791..6577037f9c00 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.md +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.md @@ -11,7 +11,12 @@ definition_2 - Scope: `container` - Public: no - Synthetic: yes +- Lazy: no +- Synchronized: no +- Abstract: no - File: `/path/to/file` +- Factory Service: `factory.service` +- Factory Method: `get` tag2 @@ -24,4 +29,9 @@ definition_2 - Scope: `container` - Public: no - Synthetic: yes +- Lazy: no +- Synchronized: no +- Abstract: no - File: `/path/to/file` +- Factory Service: `factory.service` +- Factory Method: `get` diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.json b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.json index 00a553ce23b7..9229df51dd72 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.json +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.json @@ -3,7 +3,12 @@ "scope": "container", "public": true, "synthetic": false, + "lazy": true, + "synchronized": true, + "abstract": true, "file": null, + "factory_class": "Full\\Qualified\\FactoryClass", + "factory_method": "get", "tags": [ ] diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.md index 49005b12a4a4..d9832a1511ab 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.md +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.md @@ -2,3 +2,8 @@ - Scope: `container` - Public: yes - Synthetic: no +- Lazy: yes +- Synchronized: yes +- Abstract: yes +- Factory Class: `Full\Qualified\FactoryClass` +- Factory Method: `get` diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.txt b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.txt index 74aabca95a27..3d9cbb2077c3 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.txt +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.txt @@ -4,4 +4,8 @@ Scope container Public yes Synthetic no -Required File - +Lazy yes +Synchronized yes +Abstract yes +Factory Class Full\Qualified\FactoryClass +Factory Method get diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.json b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.json index d31f146a6ad2..9d58434c17e1 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.json +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.json @@ -3,7 +3,12 @@ "scope": "container", "public": false, "synthetic": true, + "lazy": false, + "synchronized": false, + "abstract": false, "file": "\/path\/to\/file", + "factory_service": "factory.service", + "factory_method": "get", "tags": [ { "name": "tag1", diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.md index 521b496e0760..f552debbf18b 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.md +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.md @@ -2,7 +2,12 @@ - Scope: `container` - Public: no - Synthetic: yes +- Lazy: no +- Synchronized: no +- Abstract: no - File: `/path/to/file` +- Factory Service: `factory.service` +- Factory Method: `get` - Tag: `tag1` - Attr1: val1 - Attr2: val2 diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.txt b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.txt index 06b6c327cf52..28a00d583b09 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.txt +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.txt @@ -7,4 +7,9 @@ Scope container Public no Synthetic yes +Lazy no +Synchronized no +Abstract no Required File /path/to/file +Factory Service factory.service +Factory Method get diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.json b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.json index 7da10ed86143..c8ead96966fc 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.json +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.json @@ -1,6 +1,8 @@ { "path": "\/hello\/{name}", + "pathRegex": "#^\/hello(?:\/(?P[a-z]+))?$#s", "host": "localhost", + "hostRegex": "#^localhost$#s", "scheme": "http|https", "method": "GET|HEAD", "class": "Symfony\\Component\\Routing\\Route", @@ -14,6 +16,5 @@ "compiler_class": "Symfony\\Component\\Routing\\RouteCompiler", "opt1": "val1", "opt2": "val2" - }, - "pathRegex": "#^\/hello(?:\/(?P[a-z]+))?$#s" + } } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.md index 4ac00a892975..c292438b0a7b 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.md +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.md @@ -1,5 +1,7 @@ - Path: /hello/{name} +- Path Regex: #^/hello(?:/(?P[a-z]+))?$#s - Host: localhost +- Host Regex: #^localhost$#s - Scheme: http|https - Method: GET|HEAD - Class: Symfony\Component\Routing\Route diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.txt b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.txt index 2552c1ed8899..502dfc462858 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.txt +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.txt @@ -1,5 +1,7 @@ Path /hello/{name} +Path Regex #^/hello(?:/(?P[a-z]+))?$#s Host localhost +Host Regex #^localhost$#s Scheme http|https Method GET|HEAD Class Symfony\Component\Routing\Route @@ -7,6 +9,4 @@ Requirements name: [a-z]+ Options compiler_class: Symfony\Component\Routing\RouteCompiler opt1: val1 - opt2: val2 -Path-Regex #^/hello(?:/(?P[a-z]+))?$#s -Host-Regex #^localhost$#s \ No newline at end of file + opt2: val2 \ No newline at end of file diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.json b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.json index 276f8ca42a0a..8e9b899b2467 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.json +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.json @@ -1,6 +1,8 @@ { "path": "\/name\/add", + "pathRegex": "#^\/name\/add$#s", "host": "localhost", + "hostRegex": "#^localhost$#s", "scheme": "http|https", "method": "PUT|POST", "class": "Symfony\\Component\\Routing\\Route", @@ -12,6 +14,5 @@ "compiler_class": "Symfony\\Component\\Routing\\RouteCompiler", "opt1": "val1", "opt2": "val2" - }, - "pathRegex": "#^\/name\/add$#s" + } } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.md index c19d75f4f3b1..1cbb0e3004ac 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.md +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.md @@ -1,5 +1,7 @@ - Path: /name/add +- Path Regex: #^/name/add$#s - Host: localhost +- Host Regex: #^localhost$#s - Scheme: http|https - Method: PUT|POST - Class: Symfony\Component\Routing\Route diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.txt b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.txt index 99119b6cc4e9..96b7a616fe18 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.txt +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.txt @@ -1,5 +1,7 @@ Path /name/add +Path Regex #^/name/add$#s Host localhost +Host Regex #^localhost$#s Scheme http|https Method PUT|POST Class Symfony\Component\Routing\Route @@ -7,6 +9,4 @@ Requirements Options compiler_class: Symfony\Component\Routing\RouteCompiler opt1: val1 - opt2: val2 -Path-Regex #^/name/add$#s -Host-Regex #^localhost$#s \ No newline at end of file + opt2: val2 \ No newline at end of file diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.json b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.json index 0cd1610f20ae..a78320387df4 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.json +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.json @@ -1,7 +1,9 @@ { "route_1": { "path": "\/hello\/{name}", + "pathRegex": "#^\/hello(?:\/(?P[a-z]+))?$#s", "host": "localhost", + "hostRegex": "#^localhost$#s", "scheme": "http|https", "method": "GET|HEAD", "class": "Symfony\\Component\\Routing\\Route", @@ -15,12 +17,13 @@ "compiler_class": "Symfony\\Component\\Routing\\RouteCompiler", "opt1": "val1", "opt2": "val2" - }, - "pathRegex": "#^\/hello(?:\/(?P[a-z]+))?$#s" + } }, "route_2": { "path": "\/name\/add", + "pathRegex": "#^\/name\/add$#s", "host": "localhost", + "hostRegex": "#^localhost$#s", "scheme": "http|https", "method": "PUT|POST", "class": "Symfony\\Component\\Routing\\Route", @@ -32,7 +35,6 @@ "compiler_class": "Symfony\\Component\\Routing\\RouteCompiler", "opt1": "val1", "opt2": "val2" - }, - "pathRegex": "#^\/name\/add$#s" + } } } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.md index a148c23210ba..24950b1f577b 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.md +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.md @@ -2,7 +2,9 @@ route_1 ------- - Path: /hello/{name} +- Path Regex: #^/hello(?:/(?P[a-z]+))?$#s - Host: localhost +- Host Regex: #^localhost$#s - Scheme: http|https - Method: GET|HEAD - Class: Symfony\Component\Routing\Route @@ -16,7 +18,9 @@ route_2 ------- - Path: /name/add +- Path Regex: #^/name/add$#s - Host: localhost +- Host Regex: #^localhost$#s - Scheme: http|https - Method: PUT|POST - Class: Symfony\Component\Routing\Route