Skip to content
Browse files

[Yaml] fixed unneeded BC break

  • Loading branch information...
1 parent 972e1b7 commit 0138c2d0b360a92d53e990ee3695a826cbad5469 @fabpot fabpot committed Jan 17, 2013
View
6 src/Symfony/Component/Yaml/Dumper.php
@@ -40,13 +40,13 @@ public function setIndentation($num)
*
* @param mixed $input The PHP value
* @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 $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
*/
- 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 = '';
$prefix = $indent ? str_repeat(' ', $indent) : '';
@@ -63,7 +63,7 @@ public function dump($input, $inline = 0, $exceptionOnInvalidType = false, $obje
$prefix,
$isAHash ? Inline::dump($key, $exceptionOnInvalidType, $objectSupport).':' : '-',
$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" : '');
}
}
View
2 src/Symfony/Component/Yaml/Yaml.php
@@ -150,6 +150,6 @@ public static function dump($array, $inline = 2, $indent = 2, $exceptionOnInvali
$yaml = new Dumper();
$yaml->setIndentation($indent);
- return $yaml->dump($array, $inline, $exceptionOnInvalidType, $objectSupport);
+ return $yaml->dump($array, $inline, 0, $exceptionOnInvalidType, $objectSupport);
}
}
View
4 tests/Symfony/Tests/Component/Yaml/DumperTest.php
@@ -154,7 +154,7 @@ public function testInlineLevel()
public function testObjectSupportEnabled()
{
- $dump = $this->dumper->dump(array('foo' => new A(), 'bar' => 1), 0, false, true);
+ $dump = $this->dumper->dump(array('foo' => new A(), 'bar' => 1), 0, 0, false, true);
$this->assertEquals('{ foo: !!php/object:O:30:"Symfony\Tests\Component\Yaml\A":1:{s:1:"a";s:3:"foo";}, bar: 1 }', $dump, '->dump() is able to dump objects');
}
@@ -171,7 +171,7 @@ public function testObjectSupportDisabledButNoExceptions()
*/
public function testObjectSupportDisabledWithExceptions()
{
- $this->dumper->dump(array('foo' => new A(), 'bar' => 1), 0, true, false);
+ $this->dumper->dump(array('foo' => new A(), 'bar' => 1), 0, 0, true, false);
}
}

0 comments on commit 0138c2d

Please sign in to comment.
Something went wrong with that request. Please try again.