IsEqualTo   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 2
dl 0
loc 11
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 4 1
1
<?php
2
/**
3
 * File was created 29.05.2015 21:25
4
 *
5
 * @author Karsten J. Gerber <[email protected]>
6
 */
7
8
namespace PeekAndPoke\Component\Psi\Psi;
9
10
use PeekAndPoke\Component\Psi\Functions\ParameterizedUnaryFunction;
11
12
/**
13
 * EqualTo does a non type safe comparison "=="
14
 *
15
 * @see    IsEqualToIsNotEqualToTest
16
 *
17
 * @author Karsten J. Gerber <[email protected]>
18
 */
19
class IsEqualTo extends ParameterizedUnaryFunction
20
{
21
    /**
22
     * @param mixed $input
23
     *
24
     * @return bool
25
     */
26 54
    public function __invoke($input)
27
    {
28
        /** @noinspection TypeUnsafeComparisonInspection */
29 54
        return $input == $this->getValue(); // the non-type-safe comparison here is on purpose
30
    }
31
}
32