Passed
Push — master ( 14b05a...fa6902 )
by Daniel
02:41
created

UpperCaseFormatter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 21
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A format() 0 3 1
A __construct() 0 3 1
1
<?php declare(strict_types=1);
2
3
/**
4
 * This file is part of the Csv-Machine package.
5
 *
6
 * (c) Dan McAdams <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace RoadBunch\Csv\Formatter;
13
14
15
/**
16
 * Class UpperCaseFormatter
17
 *
18
 * @author  Dan McAdams
19
 * @package RoadBunch\Csv\Formatter
20
 */
21
class UpperCaseFormatter implements FormatterInterface
22
{
23
    /** @var FormatterInterface */
24
    protected $formatter;
25
26
    /**
27
     * UpperCaseFormatter constructor.
28
     */
29 2
    public function __construct()
30
    {
31 2
        $this->formatter = new Formatter('mb_strtoupper');
32 2
    }
33
34
    /**
35
     * @param array $data
36
     *
37
     * @return array
38
     */
39 1
    public function format(array $data): array
40
    {
41 1
        return $this->formatter->format($data);
42
    }
43
}
44