Completed
Push — master ( 1358d6...984c1e )
by Karsten
01:40
created

ToLower::__invoke()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 9.4285
cc 2
eloc 4
nc 2
nop 1
crap 2
1
<?php
2
/**
3
 * Created by gerk on 20.11.17 08:43
4
 */
5
6
namespace PeekAndPoke\Component\Psi\Psi\Str;
7
8
use PeekAndPoke\Component\Psi\Interfaces\UnaryFunction;
9
10
/**
11
 *
12
 *
13
 * @author Karsten J. Gerber <[email protected]>
14
 */
15
class ToLower implements UnaryFunction
16
{
17
    /**
18
     * @param mixed $input
19
     *
20
     * @return mixed
21
     */
22 8
    public function __invoke($input)
23
    {
24 8
        if (! is_scalar($input)) {
25 3
            return null;
26
        }
27
28 5
        return strtolower($input);
29
    }
30
}
31