8000 Fixes · symfony/symfony-docs@647c117 · GitHub
[go: up one dir, main page]

Skip to content

Commit 647c117

Browse files
committed
Fixes
1 parent b55b03a commit 647c117

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

components/yaml.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff 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

126126
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::
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.

0 commit comments

Comments
 (0)
0