StreamOutputEventSubscriber   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 8
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handleOutput() 0 5 2
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