Passed
Push — main ( 90c8f5...cf7c53 )
by Daniel
01:54
created

AbstractFormatter::formatList()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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