Passed
Push — master ( bce6b5...b40887 )
by Aurimas
02:19
created

NonCacheableClosure.php$0 ➔ __invoke()   A

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
dl 0
loc 3
ccs 0
cts 0
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Setherator\Variables;
6
7
use Closure;
8
9
/**
10
 * @author Aurimas Niekis <[email protected]>
11
 */
12
class NonCacheableClosure
13
{
14
    private Closure $closure;
15
16 6
    public function __construct(Closure $closure)
17
    {
18 6
        $this->closure = $closure;
19 6
    }
20
21 6
    public function __invoke()
22
    {
23 6
        $closure = $this->closure;
24
25 6
        return $closure();
26
    }
27
}
28