Passed
Push — master ( 0e441f...fe9525 )
by Daniel
02:35
created

UpperCaseWordsFormatter::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 7
ccs 5
cts 5
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
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\Formatters;
13
14
15
/**
16
 * Class UpperCaseWordsFormatter
17
 *
18
 * @author  Dan McAdams
19
 * @package RoadBunch\Csv\Formatters
20
 */
21
class UpperCaseWordsFormatter extends Formatter
22
{
23
    /**
24
     * UpperCaseWordsFormatter constructor.
25
     */
26
    public function __construct()
27
    {
28 2
        $ucaseWords = function($var) {
29 1
            $del = [" ", "-", "_", "."];
30 1
            return ucwords($var, implode('', $del));
31 2
        };
32 2
        parent::__construct($ucaseWords);
33 2
    }
34
}
35