Skip to content

[Yaml] Match signature of Yaml::parse() with Parser->parse() #14412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 27, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Symfony/Component/Yaml/Yaml.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand All @@ -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 = '';
Expand All @@ -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);
Expand Down