Completed
Push — master ( c3dbdd...afb6b5 )
by Magnar Ovedal
05:59 queued 02:28
created

UpperCaseMap::getMap()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 1
dl 0
loc 7
ccs 5
cts 5
cp 1
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stadly\PasswordPolice\CodeMap;
6
7
use Stadly\PasswordPolice\CharTree;
8
use Stadly\PasswordPolice\CodeMap;
9
10
final class UpperCaseMap implements CodeMap
11
{
12
    /**
13
     * {@inheritDoc}
14
     */
15 1
    public function getMap(CharTree $charTree): array
16
    {
17 1
        $codeMap = [];
18 1
        foreach ($charTree->getTreeTrimmedToLength(1) as $char) {
19 1
            $codeMap[$char] = [mb_strtoupper($char)];
20
        }
21 1
        return $codeMap;
22
    }
23
}
24