TrimConverter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 9
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0

1 Method

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