8000 minor #9776 Documented the support of iterators in write() and writel… · symfony/symfony-docs@7dc019e · GitHub
[go: up one dir, main page]

Skip to content

Commit 7dc019e

Browse files
committed
minor #9776 Documented the support of iterators in write() and writeln() (javiereguiluz)
This PR was squashed before being merged into the 4.1 branch (closes #9776). Discussion ---------- Documented the support of iterators in write() and writeln() This fixes #9634. Commits ------- f9b9c10 Documented the support of iterators in write() and writeln()
2 parents 3420f0c + f9b9c10 commit 7dc019e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

console.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ messages to the console)::
101101
'',
102102
]);
103103

104+
// the value returned by someMethod() can be an iterator (https://secure.php.net/iterator)
105+
// that generates and returns the messages with the 'yield' PHP keyword
106+
$output->writeln($this->someMethod());
107+
104108
// outputs a message followed by a "\n"
105109
$output->writeln('Whoa!');
106110

@@ -109,6 +113,10 @@ messages to the console)::
109113
$output->write('create a user.');
110114
}
111115

116+
.. versionadded:: 4.1
117+
The support of PHP iterators in the ``write()`` and ``writeln()`` methods
118+
was introduced in Symfony 4.1.
119+
112120
Now, try executing the command:
113121

114122
.. code-block:: terminal

0 commit comments

Comments
 (0)
0