Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch '2.0' into 2.1

* 2.0:
  [Yaml] fixed unneeded BC break
  [DependencyInjection] fixed a bug in the YAML dumper where references where not converted to the @ notation
  [Yaml] fixed typo
  updated VERSION for 2.0.22
  update CONTRIBUTORS for 2.0.22
  updated CHANGELOG for 2.0.22

Conflicts:
	src/Symfony/Component/HttpKernel/Kernel.php
  • Loading branch information...
commit 1ab2bd470518b75daca8b43d4293b4c0fafe6bca 2 parents b2d680c + 67069f6
@fabpot fabpot authored
Showing with 7 additions and 7 deletions.
  1. +3 −3 Dumper.php
  2. +2 −2 Tests/DumperTest.php
  3. +2 −2 Yaml.php
View
6 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
4 Tests/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\Component\Yaml\Tests\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);
}
}
View
4 Yaml.php
@@ -145,11 +145,11 @@ public static function parse($input, $exceptionOnInvalidType = false, $objectSup
*
* @api
*/
- public static function dump($array, $inline = 2, $indent = 4, $exceptionOnInvalidType = false, $objectSupport = false)
+ public static function dump($array, $inline = 2, $indent = 2, $exceptionOnInvalidType = false, $objectSupport = false)
{
$yaml = new Dumper();
$yaml->setIndentation($indent);
- return $yaml->dump($array, $inline, $exceptionOnInvalidType, $objectSupport);
+ return $yaml->dump($array, $inline, 0, $exceptionOnInvalidType, $objectSupport);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.