From 238589d4e8135f896dd0cbc16fd1853bf6476422 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Blaise?= Date: Sun, 19 Apr 2015 18:34:12 +0200 Subject: [PATCH] Add $objectForMap as argument of Yaml::parse() --- src/Symfony/Component/Yaml/Yaml.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Yaml/Yaml.php b/src/Symfony/Component/Yaml/Yaml.php index c9295b094bb0..e17698a07c74 100644 --- a/src/Symfony/Component/Yaml/Yaml.php +++ b/src/Symfony/Component/Yaml/Yaml.php @@ -41,6 +41,7 @@ class Yaml * @param string $input Path to a YAML file or a string containing YAML * @param bool $exceptionOnInvalidType True if an exception must be thrown on invalid types false otherwise * @param bool $objectSupport True if object support is enabled, false otherwise + * @param bool $objectForMap True if maps should return a stdClass instead of array() * * @return array The YAML converted to a PHP array * @@ -50,7 +51,7 @@ class Yaml * * @api */ - public static function parse($input, $exceptionOnInvalidType = false, $objectSupport = false) + public static function parse($input, $exceptionOnInvalidType = false, $objectSupport = false, $objectForMap = false) { // if input is a file, process it $file = ''; @@ -68,7 +69,7 @@ public static function parse($input, $exceptionOnInvalidType = false, $objectSup $yaml = new Parser(); try { - return $yaml->parse($input, $exceptionOnInvalidType, $objectSupport); + return $yaml->parse($input, $exceptionOnInvalidType, $objectSupport, $objectForMap); } catch (ParseException $e) { if ($file) { $e->setParsedFile($file);