Comment::format()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace MyBuilder\Cronos\Formatter;
4
5
class Comment
6
{
7
    /** @var string */
8
    private $comment;
9
10
    public function __construct(string $comment)
11
    {
12
        $this->comment = $comment;
13
    }
14
15
    public function format(): string
16
    {
17
        return '#' . $this->removeLineBreaks($this->comment);
18
    }
19
20
    private function removeLineBreaks($text): string
21
    {
22
        return \str_replace(["\r", "\r\n", "\n", \PHP_EOL], '', $text);
23
    }
24
}
25