Skip to content

Commit 3a404f8

Browse files
committed
minor #14412 [Yaml] Match signature of Yaml::parse() with Parser->parse() (Zzortell)
This PR was merged into the 2.7 branch. Discussion ---------- [Yaml] Match signature of Yaml::parse() with Parser->parse() | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Commits ------- 238589d Add $objectForMap as argument of Yaml::parse()
2 parents 501df8d + 238589d commit 3a404f8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Symfony/Component/Yaml/Yaml.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class Yaml
4141
* @param string $input Path to a YAML file or a string containing YAML
4242
* @param bool $exceptionOnInvalidType True if an exception must be thrown on invalid types false otherwise
4343
* @param bool $objectSupport True if object support is enabled, false otherwise
44+
* @param bool $objectForMap True if maps should return a stdClass instead of array()
4445
*
4546
* @return array The YAML converted to a PHP array
4647
*
@@ -50,7 +51,7 @@ class Yaml
5051
*
5152
* @api
5253
*/
53-
public static function parse($input, $exceptionOnInvalidType = false, $objectSupport = false)
54+
public static function parse($input, $exceptionOnInvalidType = false, $objectSupport = false, $objectForMap = false)
5455
{
5556
// if input is a file, process it
5657
$file = '';
@@ -68,7 +69,7 @@ public static function parse($input, $exceptionOnInvalidType = false, $objectSup
6869
$yaml = new Parser();
6970

7071
try {
71-
return $yaml->parse($input, $exceptionOnInvalidType, $objectSupport);
72+
return $yaml->parse($input, $exceptionOnInvalidType, $objectSupport, $objectForMap);
7273
} catch (ParseException $e) {
7374
if ($file) {
7475
$e->setParsedFile($file);

0 commit comments

Comments
 (0)