From 808dcc8dcfd5e432bf3ea7dc27c0bb6a1a656f29 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Thu, 23 Jun 2016 19:50:58 +0200 Subject: [PATCH] rename boolean and integer to bool and int --- src/Symfony/Component/Routing/CHANGELOG.md | 2 +- .../Component/Routing/Loader/XmlFileLoader.php | 12 ++++++------ .../Loader/schema/routing/routing-1.0.xsd | 16 ++++++++-------- .../Routing/Tests/Fixtures/list_defaults.xml | 4 ++-- .../Tests/Fixtures/list_in_list_defaults.xml | 4 ++-- .../Tests/Fixtures/list_in_map_defaults.xml | 4 ++-- .../Routing/Tests/Fixtures/list_null_values.xml | 4 ++-- .../Routing/Tests/Fixtures/map_defaults.xml | 4 ++-- .../Tests/Fixtures/map_in_list_defaults.xml | 4 ++-- .../Tests/Fixtures/map_in_map_defaults.xml | 4 ++-- .../Routing/Tests/Fixtures/map_null_values.xml | 4 ++-- .../Routing/Tests/Fixtures/namespaceprefix.xml | 2 +- .../Routing/Tests/Fixtures/scalar_defaults.xml | 10 +++++----- 13 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/Symfony/Component/Routing/CHANGELOG.md b/src/Symfony/Component/Routing/CHANGELOG.md index 8c3d3e8601..19fa0d3bcb 100644 --- a/src/Symfony/Component/Routing/CHANGELOG.md +++ b/src/Symfony/Component/Routing/CHANGELOG.md @@ -4,7 +4,7 @@ CHANGELOG 3.2.0 ----- - * Added support for `boolean`, `integer`, `float`, `string`, `list` and `map` defaults. + * Added support for `bool`, `int`, `float`, `string`, `list` and `map` defaults in XML configurations. 2.8.0 ----- diff --git a/src/Symfony/Component/Routing/Loader/XmlFileLoader.php b/src/Symfony/Component/Routing/Loader/XmlFileLoader.php index 2587ed12f8..aff0ba27ee 100644 --- a/src/Symfony/Component/Routing/Loader/XmlFileLoader.php +++ b/src/Symfony/Component/Routing/Loader/XmlFileLoader.php @@ -261,9 +261,9 @@ class XmlFileLoader extends FileLoader return $this->parseDefaultNode($child, $path); } - // If the default element doesn't contain a nested "boolean", "integer", - // "float", "string", "list" or "map" element, the element contents will - // be treated as the string value of the associated default option. + // If the default element doesn't contain a nested "bool", "int", "float", + // "string", "list", or "map" element, the element contents will be treated + // as the string value of the associated default option. return trim($element->textContent); } @@ -284,9 +284,9 @@ class XmlFileLoader extends FileLoader } switch ($node->localName) { - case 'boolean': + case 'bool': return 'true' === trim($node->nodeValue) || '1' === trim($node->nodeValue); - case 'integer': + case 'int': return (int) trim($node->nodeValue); case 'float': return (float) trim($node->nodeValue); @@ -325,7 +325,7 @@ class XmlFileLoader extends FileLoader return $map; default: - throw new \InvalidArgumentException(sprintf('Unknown tag "%s" used in file "%s". Expected "boolean", "integer", "float", "string", "list" or "map".', $node->localName, $path)); + throw new \InvalidArgumentException(sprintf('Unknown tag "%s" used in file "%s". Expected "bool", "int", "float", "string", "list", or "map".', $node->localName, $path)); } } diff --git a/src/Symfony/Component/Routing/Loader/schema/routing/routing-1.0.xsd b/src/Symfony/Component/Routing/Loader/schema/routing/routing-1.0.xsd index b98d3df919..92d4ae2078 100644 --- a/src/Symfony/Component/Routing/Loader/schema/routing/routing-1.0.xsd +++ b/src/Symfony/Component/Routing/Loader/schema/routing/routing-1.0.xsd @@ -56,8 +56,8 @@ - - + + @@ -76,8 +76,8 @@ - - + + @@ -87,8 +87,8 @@ - - + + @@ -96,7 +96,7 @@ - + @@ -104,7 +104,7 @@ - + diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/list_defaults.xml b/src/Symfony/Component/Routing/Tests/Fixtures/list_defaults.xml index 40308945ff..f93bf9c6ae 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/list_defaults.xml +++ b/src/Symfony/Component/Routing/Tests/Fixtures/list_defaults.xml @@ -10,8 +10,8 @@ - true - 1 + true + 1 3.5 foo diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/list_in_list_defaults.xml b/src/Symfony/Component/Routing/Tests/Fixtures/list_in_list_defaults.xml index 08c3c93d83..987086dbdf 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/list_in_list_defaults.xml +++ b/src/Symfony/Component/Routing/Tests/Fixtures/list_in_list_defaults.xml @@ -11,8 +11,8 @@ - true - 1 + true + 1 3.5 foo diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/list_in_map_defaults.xml b/src/Symfony/Component/Routing/Tests/Fixtures/list_in_map_defaults.xml index 35fe31d313..32d393c56f 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/list_in_map_defaults.xml +++ b/src/Symfony/Component/Routing/Tests/Fixtures/list_in_map_defaults.xml @@ -11,8 +11,8 @@ - true - 1 + true + 1 3.5 foo diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/list_null_values.xml b/src/Symfony/Component/Routing/Tests/Fixtures/list_null_values.xml index c2930da10e..c70e03ccc6 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/list_null_values.xml +++ b/src/Symfony/Component/Routing/Tests/Fixtures/list_null_values.xml @@ -10,8 +10,8 @@ - - + + diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/map_defaults.xml b/src/Symfony/Component/Routing/Tests/Fixtures/map_defaults.xml index e6e22bd78c..47feb29b9a 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/map_defaults.xml +++ b/src/Symfony/Component/Routing/Tests/Fixtures/map_defaults.xml @@ -10,8 +10,8 @@ - true - 1 + true + 1 3.5 foo diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/map_in_list_defaults.xml b/src/Symfony/Component/Routing/Tests/Fixtures/map_in_list_defaults.xml index dec8d16afa..6d770653bb 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/map_in_list_defaults.xml +++ b/src/Symfony/Component/Routing/Tests/Fixtures/map_in_list_defaults.xml @@ -11,8 +11,8 @@ - true - 1 + true + 1 3.5 foo diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/map_in_map_defaults.xml b/src/Symfony/Component/Routing/Tests/Fixtures/map_in_map_defaults.xml index 5ccde07a09..2beee61433 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/map_in_map_defaults.xml +++ b/src/Symfony/Component/Routing/Tests/Fixtures/map_in_map_defaults.xml @@ -11,8 +11,8 @@ - true - 1 + true + 1 3.5 foo diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/map_null_values.xml b/src/Symfony/Component/Routing/Tests/Fixtures/map_null_values.xml index 424d67f850..8fd8954e02 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/map_null_values.xml +++ b/src/Symfony/Component/Routing/Tests/Fixtures/map_null_values.xml @@ -10,8 +10,8 @@ - - + + diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/namespaceprefix.xml b/src/Symfony/Component/Routing/Tests/Fixtures/namespaceprefix.xml index 7980459009..e33955ae47 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/namespaceprefix.xml +++ b/src/Symfony/Component/Routing/Tests/Fixtures/namespaceprefix.xml @@ -10,7 +10,7 @@ en|fr|de RouteCompiler - 1 + 1 diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/scalar_defaults.xml b/src/Symfony/Component/Routing/Tests/Fixtures/scalar_defaults.xml index b2f9c0aaab..ecfde2801e 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/scalar_defaults.xml +++ b/src/Symfony/Component/Routing/Tests/Fixtures/scalar_defaults.xml @@ -10,22 +10,22 @@ - true + true - 1 + 1 3.5 - false + false - 1 + 1 - 0 + 0