BufferedOutput.php
2 years ago
ConsoleOutput.php
1 year ago
ConsoleOutputInterface.php
2 years ago
ConsoleSectionOutput.php
1 year ago
NullOutput.php
1 year ago
Output.php
1 year ago
OutputInterface.php
1 year ago
StreamOutput.php
1 year ago
TrimmedBufferOutput.php
1 year ago
BufferedOutput.php
41 lines
| 1 | <?php |
| 2 | |
| 3 | /* |
| 4 | * This file is part of the Symfony package. |
| 5 | * |
| 6 | * (c) Fabien Potencier <fabien@symfony.com> |
| 7 | * |
| 8 | * For the full copyright and license information, please view the LICENSE |
| 9 | * file that was distributed with this source code. |
| 10 | */ |
| 11 | namespace Matomo\Dependencies\Symfony\Component\Console\Output; |
| 12 | |
| 13 | /** |
| 14 | * @author Jean-François Simon <contact@jfsimon.fr> |
| 15 | */ |
| 16 | class BufferedOutput extends Output |
| 17 | { |
| 18 | private $buffer = ''; |
| 19 | /** |
| 20 | * Empties buffer and returns its content. |
| 21 | * |
| 22 | * @return string |
| 23 | */ |
| 24 | public function fetch() |
| 25 | { |
| 26 | $content = $this->buffer; |
| 27 | $this->buffer = ''; |
| 28 | return $content; |
| 29 | } |
| 30 | /** |
| 31 | * {@inheritdoc} |
| 32 | */ |
| 33 | protected function doWrite(string $message, bool $newline) |
| 34 | { |
| 35 | $this->buffer .= $message; |
| 36 | if ($newline) { |
| 37 | $this->buffer .= \PHP_EOL; |
| 38 | } |
| 39 | } |
| 40 | } |
| 41 |