This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/Yaml
sun 5be7237b69 Added Yaml\Dumper::setIndentation() method to allow a custom indentation level of nested nodes.
YAML does not specify an absolute indentation level, but a consistent indentation of nested nodes only: http://www.yaml.org/spec/1.2/spec.html#space/indentation/

Projects that are generally using 2 spaces for indentation should be able to retain consistency with their coding standards by supplying a custom value for the new $indent parameter added to Yaml::dump(), or the new Dumper::setIndentation() method.

The new parameter is a backwards-compatible API addition and defaults to the previous default of 4 (which was changed from 2 via PR #2242 only recently).
2012-08-05 08:07:18 +02:00
..
Exception fixed some phpdoc 2012-01-11 15:46:50 +01:00
Tests fixed CS 2012-07-09 14:54:20 +02:00
CHANGELOG.md [Yaml] added CHANGELOG 2012-04-26 19:44:03 +02:00
composer.json Revert "raised the minimum version of PHP to 5.3.4 (closes #3856)" 2012-07-15 12:13:51 +02:00
Dumper.php Added Yaml\Dumper::setIndentation() method to allow a custom indentation level of nested nodes. 2012-08-05 08:07:18 +02:00
Escaper.php fixed CS 2012-07-09 14:54:20 +02:00
Inline.php fixed CS 2012-07-09 14:54:20 +02:00
LICENSE Updated LICENSE files copyright 2012-02-22 10:10:37 +01:00
Parser.php [Yaml] fixed parsing when a mapping is mixed within a sequence and vice-versa (closes #4634) 2012-07-01 11:19:53 +02:00
phpunit.xml.dist [Components] Tests/Autoloading fixes 2012-05-01 17:51:41 +02:00
README.md [Components] Tests/Autoloading fixes 2012-05-01 17:51:41 +02:00
Unescaper.php fixed CS 2012-07-09 14:54:20 +02:00
Yaml.php Added Yaml\Dumper::setIndentation() method to allow a custom indentation level of nested nodes. 2012-08-05 08:07:18 +02:00

Yaml Component

YAML implements most of the YAML 1.2 specification.

use Symfony\Component\Yaml\Yaml;

$array = Yaml::parse($file);

print Yaml::dump($array);

Resources

You can run the unit tests with the following command:

phpunit