Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Illuminate\Console;
4
 
5
use Symfony\Component\Console\Output\ConsoleOutput;
6
 
7
class BufferedConsoleOutput extends ConsoleOutput
8
{
9
    /**
10
     * The current buffer.
11
     *
12
     * @var string
13
     */
14
    protected $buffer = '';
15
 
16
    /**
17
     * Empties the buffer and returns its content.
18
     *
19
     * @return string
20
     */
21
    public function fetch()
22
    {
23
        return tap($this->buffer, function () {
24
            $this->buffer = '';
25
        });
26
    }
27
 
28
    /**
29
     * {@inheritdoc}
30
     */
31
    protected function doWrite(string $message, bool $newline)
32
    {
33
        $this->buffer .= $message;
34
 
35
        if ($newline) {
36
            $this->buffer .= \PHP_EOL;
37
        }
38
 
39
        return parent::doWrite($message, $newline);
40
    }
41
}