AbstractFormatter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 5
c 2
b 0
f 0
dl 0
loc 11
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A formatList() 0 7 2
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