StrtolowerValueConverter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 17
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A convert() 0 8 2
1
<?php
2
3
namespace Jh\DataImportMagento\ValueConverter;
4
5
use Ddeboer\DataImport\Exception\UnexpectedTypeException;
6
use Ddeboer\DataImport\ValueConverter\ValueConverterInterface;
7
8
/**
9
 * Class StrtolowerValueConverter
10
 * @package Jh\DataImportMagento\ValueConverter
11
 * @author Aydin Hassan <[email protected]>
12
 */
13
class StrtolowerValueConverter implements ValueConverterInterface
14
{
15
16
    /**
17
     * @param string $input
18
     * @return string
19
     * @throws UnexpectedTypeException
20
     */
21
    public function convert($input)
22
    {
23
        if (!is_string($input)) {
24
            throw new UnexpectedTypeException($input, 'string');
25
        }
26
27
        return strtolower($input);
28
    }
29
}
30