Skip to content

Commit

Permalink
minor #19327 [Yaml] Fix PHPDoc of the Yaml class (dunglas)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 2.7 branch (closes #19327).

Discussion
----------

[Yaml] Fix PHPDoc of the Yaml class

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

The YAML dumper is able to serialize any PHP type, not just arrays.

Commits
-------

a3fd991 [Yaml] Fix PHPDoc of the Yaml class
  • Loading branch information
xabbuh committed Jul 11, 2016
2 parents 500c2cd + a3fd991 commit 5922d71
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Symfony/Component/Yaml/Yaml.php
Expand Up @@ -73,20 +73,20 @@ public static function parse($input, $exceptionOnInvalidType = false, $objectSup
}

/**
* Dumps a PHP array to a YAML string.
* Dumps a PHP value to a YAML string.
*
* The dump method, when supplied with an array, will do its best
* to convert the array into friendly YAML.
*
* @param array $array PHP array
* @param mixed $input The PHP value
* @param int $inline The level where you switch to inline YAML
* @param int $indent The amount of spaces to use for indentation of nested nodes
* @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise
* @param bool $objectSupport true if object support is enabled, false otherwise
*
* @return string A YAML string representing the original PHP array
* @return string A YAML string representing the original PHP value
*/
public static function dump($array, $inline = 2, $indent = 4, $exceptionOnInvalidType = false, $objectSupport = false)
public static function dump($input, $inline = 2, $indent = 4, $exceptionOnInvalidType = false, $objectSupport = false)
{
if ($indent < 1) {
throw new \InvalidArgumentException('The indentation must be greater than zero.');
Expand All @@ -95,6 +95,6 @@ public static function dump($array, $inline = 2, $indent = 4, $exceptionOnInvali
$yaml = new Dumper();
$yaml->setIndentation($indent);

return $yaml->dump($array, $inline, 0, $exceptionOnInvalidType, $objectSupport);
return $yaml->dump($input, $inline, 0, $exceptionOnInvalidType, $objectSupport);
}
}

0 comments on commit 5922d71

Please sign in to comment.