AbstractFormatter::formatList()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 2
b 0
f 0
nc 2
nop 1
dl 0
loc 7
rs 10
1
<?php
2
declare(strict_types=1);
3
4
namespace RoadBunch\StringBean;
5
6
7
abstract class AbstractFormatter implements FormatterInterface
8
{
9
    abstract public function format(string $subject): string;
10
11
    public function formatList(string ...$subject): array
12
    {
13
        $list = [];
14
        foreach ($subject as $item) {
15
            $list[] = $this->format($item);
16
        }
17
        return $list;
18
    }
19
}
20