File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ string and converts it to a PHP array:
102102
103103 use Symfony\Component\Yaml\Yaml;
104104
105- $value = Yaml::parse("foo:\n ' bar' ");
105+ $value = Yaml::parse("foo: bar");
106106 // $value = array('foo' => 'bar')
107107
108108 If an error occurs during parsing, the parser throws a
@@ -124,13 +124,11 @@ Reading YAML Files
124124~~~~~~~~~~~~~~~~~~
125125
126126The :method: `Symfony\\ Component\\ Yaml\\ Yaml::parseFile ` method parses the YAML
127- contents of the given file path and converts them to a PHP array:
128-
129- .. code-block :: php
127+ contents of the given file path and converts them to a PHP value::
130128
131129 use Symfony\Component\Yaml\Yaml;
132130
133- $value = Yaml::parseFile(file_get_contents( '/path/to/file.yml') );
131+ $value = Yaml::parseFile('/path/to/file.yml');
134132
135133.. versionadded :: 3.4
136134 The ``parseFile() `` method was introduced in Symfony 3.4.
You can’t perform that action at this time.
0 commit comments