Stdout   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 6
c 2
b 0
f 0
dl 0
loc 20
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A write() 0 3 1
A writeln() 0 6 2
1
<?php
2
3
namespace pjpawel\LightApi\Command\Output;
4
5
class Stdout implements OutputInterface
6
{
7
8
    /**
9
     * @inheritDoc
10
     */
11
    public function write(string $text): void
12
    {
13
        echo $text;
14
    }
15
16
    /**
17
     * @inheritDoc
18
     */
19
    public function writeln(array|string $text): void
20
    {
21
        if (is_array($text)) {
0 ignored issues
show
introduced by
The condition is_array($text) is always true.
Loading history...
22
            echo implode(PHP_EOL, $text) . PHP_EOL;
23
        } else {
24
            echo $text . PHP_EOL;
25
        }
26
    }
27
}