TrimConverter::convert()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 6
1
<?php
2
3
namespace Mathielen\DataImport\ItemConverter;
4
5
use Ddeboer\DataImport\ItemConverter\ItemConverterInterface;
6
7
class TrimConverter implements ItemConverterInterface
8
{
9
    public function convert($input)
10
    {
11
        return is_array($input) ? array_map(function ($item) {
0 ignored issues
show
Bug Compatibility introduced by
The expression is_array($input) ? array...$input) : trim($input); of type array|string adds the type string to the return on line 11 which is incompatible with the return type declared by the interface Ddeboer\DataImport\ItemC...erterInterface::convert of type array|null.
Loading history...
12
            return trim($item);
13
        }, $input) : trim($input);
14
    }
15
}
16