Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f9b9c10

Browse files
committed
Documented the support of iterators in write() and writeln()
1 parent 528857d commit f9b9c10

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)