Passed
Push — master ( bd9b71...744b59 )
by Magnar Ovedal
06:07 queued 02:44
created

LowerCaseMap::getMap()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 1
dl 0
loc 7
ccs 0
cts 7
cp 0
crap 6
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 LowerCaseMap implements CodeMap
11
{
12
    /**
13
     * {@inheritDoc}
14
     */
15
    public function getMap(CharTree $charTree): array
16
    {
17
        $codeMap = [];
18
        foreach ($charTree->getTreeTrimmedToLength(1) as $char) {
19
            $codeMap[$char] = [mb_strtolower($char)];
20
        }
21
        return $codeMap;
22
    }
23
}
24