Passed
Pull Request — master (#2)
by Pol
02:21
created

K::closure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace loophp\combinator\Combinator;
6
7
use loophp\combinator\Combinator;
8
9
/**
10
 * Class K.
11
 *
12
 * @psalm-template XType
13
 * @psalm-template ResultType
14
 */
15
final class K extends Combinator
16
{
17
    /**
18
     * @var mixed
19
     */
20
    private $x;
21
22
    /**
23
     * @var mixed
24
     */
25
    private $y;
26
27
    /**
28
     * K constructor.
29
     *
30
     * @psalm-param XType $x
31
     * @psalm-param XType $y
32
     *
33
     * @param mixed $x
34
     * @param mixed $y
35
     */
36 1
    public function __construct($x, $y)
37
    {
38 1
        $this->x = $x;
39 1
        $this->y = $y;
40 1
    }
41
42
    /**
43
     * @psalm-return XType
44
     */
45 1
    public function __invoke()
46
    {
47 1
        return $this->x;
48
    }
49
}
50