StreamOutputEventSubscriber::handleOutput()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GitWrapper\EventSubscriber;
6
7
use GitWrapper\Event\GitOutputEvent;
8
9
/**
10
 * Event handler that streams real-time output from Git commands to STDOUT and
11
 * STDERR.
12
 */
13
final class StreamOutputEventSubscriber extends AbstractOutputEventSubscriber
14
{
15
    public function handleOutput(GitOutputEvent $gitOutputEvent): void
16
    {
17
        $handler = $gitOutputEvent->isError() ? STDERR : STDOUT;
18
        fputs($handler, $gitOutputEvent->getBuffer());
19
    }
20
}
21