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

UpperCaseMap   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

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