Stdout::write()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 2
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
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
}