Basic   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 14
ccs 7
cts 7
cp 1
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A parseInput() 0 12 3
1
<?php
2
3
namespace kalanis\kw_input\Parsers;
4
5
6
/**
7
 * Class Basic
8
 * @package kalanis\kw_input\Parsers
9
 * Parse any input for problematic chars
10
 */
11
class Basic extends AParser
12
{
13 5
    public function parseInput(array $input): array
14
    {
15 5
        $trimArray = [];
16 5
        foreach ($input as $key => $value) {
17 5
            if (is_array($value)) {
18 5
                $trimArray[$this->removeNullBytes($key)] = $this->parseInput($value);
19
            } else {
20 5
                $trimArray[$this->removeNullBytes($key)] = $this->removeNullBytes(trim(strval($value)));
21
            }
22
        }
23
        // @phpstan-ignore-next-line
24 5
        return $trimArray;
25
    }
26
}
27