Stdout::writeln()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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