Completed
Push — master ( 36249c...ba9366 )
by Karsten
03:21
created

AbstractBinaryFunctionOperation   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 66.67%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 0
dl 0
loc 18
ccs 4
cts 6
cp 0.6667
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 2
1
<?php
2
/**
3
 * File was created 07.05.2015 12:08
4
 *
5
 * @author Karsten J. Gerber <[email protected]>
6
 */
7
namespace PeekAndPoke\Component\Psi\Operation;
8
9
use PeekAndPoke\Component\Psi\Interfaces\Functions\BinaryFunctionInterface;
10
11
/**
12
 * AbstractBinaryFunctionOperation
13
 *
14
 * @author Karsten J. Gerber <[email protected]>
15
 */
16
abstract class AbstractBinaryFunctionOperation
17
{
18
    /** @var \Closure|BinaryFunctionInterface */
19
    protected $biFunction;
20
21
    /**
22
     * @param \Closure|BinaryFunctionInterface $biFunction
23
     */
24 18
    public function __construct($biFunction)
25
    {
26 18
        if ($biFunction instanceof BinaryFunctionInterface) {
27
            $this->biFunction = $biFunction;
28
        } else {
29
            // TODO: add a check that this is a \Closure and that is has the correct number of parameters
30 18
            $this->biFunction = $biFunction;
31
        }
32 18
    }
33
}
34