Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Yaml] fixed unneeded BC break
  • Loading branch information
fabpot committed Jan 17, 2013
1 parent 3f0e5d3 commit 67069f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Dumper.php
Expand Up @@ -40,13 +40,13 @@ public function setIndentation($num)
* *
* @param mixed $input The PHP value * @param mixed $input The PHP value
* @param integer $inline The level where you switch to inline YAML * @param integer $inline The level where you switch to inline YAML
* @param integer $indent The level of indentation (used internally)
* @param Boolean $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise * @param Boolean $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise
* @param Boolean $objectSupport true if object support is enabled, false otherwise * @param Boolean $objectSupport true if object support is enabled, false otherwise
* @param integer $indent The level of indentation (used internally)
* *
* @return string The YAML representation of the PHP value * @return string The YAML representation of the PHP value
*/ */
public function dump($input, $inline = 0, $exceptionOnInvalidType = false, $objectSupport = false, $indent = 0) public function dump($input, $inline = 0, $indent = 0, $exceptionOnInvalidType = false, $objectSupport = false)
{ {
$output = ''; $output = '';
$prefix = $indent ? str_repeat(' ', $indent) : ''; $prefix = $indent ? str_repeat(' ', $indent) : '';
Expand All @@ -63,7 +63,7 @@ public function dump($input, $inline = 0, $exceptionOnInvalidType = false, $obje
$prefix, $prefix,
$isAHash ? Inline::dump($key, $exceptionOnInvalidType, $objectSupport).':' : '-', $isAHash ? Inline::dump($key, $exceptionOnInvalidType, $objectSupport).':' : '-',
$willBeInlined ? ' ' : "\n", $willBeInlined ? ' ' : "\n",
$this->dump($value, $inline - 1, $exceptionOnInvalidType, $objectSupport, $willBeInlined ? 0 : $indent + $this->indentation) $this->dump($value, $inline - 1, $willBeInlined ? 0 : $indent + $this->indentation, $exceptionOnInvalidType, $objectSupport)
).($willBeInlined ? "\n" : ''); ).($willBeInlined ? "\n" : '');
} }
} }
Expand Down
2 changes: 1 addition & 1 deletion Yaml.php
Expand Up @@ -150,6 +150,6 @@ public static function dump($array, $inline = 2, $indent = 2, $exceptionOnInvali
$yaml = new Dumper(); $yaml = new Dumper();
$yaml->setIndentation($indent); $yaml->setIndentation($indent);


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

0 comments on commit 67069f6

Please sign in to comment.