File tree 1 file changed +3
-5
lines changed
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:
102
102
103
103
use Symfony\Component\Yaml\Yaml;
104
104
105
- $value = Yaml::parse("foo:\n ' bar' ");
105
+ $value = Yaml::parse("foo: bar");
106
106
// $value = array('foo' => 'bar')
107
107
108
108
If an error occurs during parsing, the parser throws a
@@ -124,13 +124,11 @@ Reading YAML Files
124
124
~~~~~~~~~~~~~~~~~~
125
125
126
126
The :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::
130
128
131
129
use Symfony\Component\Yaml\Yaml;
132
130
133
- $value = Yaml::parseFile(file_get_contents( '/path/to/file.yml') );
131
+ $value = Yaml::parseFile('/path/to/file.yml');
134
132
135
133
.. versionadded :: 3.4
136
134
The ``parseFile() `` method was introduced in Symfony 3.4.
You can’t perform that action at this time.
0 commit comments