Passed
Push — master ( 12b4e1...e176ef )
by Lynh
13:05
created

LazyEvaluation   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 26
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A __invoke() 0 3 1
1
<?php
2
3
namespace Jenky\Hermes;
4
5
class LazyEvaluation
6
{
7
    /**
8
     * @var callable
9
     */
10
    protected $callable;
11
12
    /**
13
     * Create a new lazy evaluation instance.
14
     *
15
     * @param  callable $callable
16
     * @return void
17
     */
18
    public function __construct(callable $callable)
19
    {
20
        $this->callable = $callable;
21
    }
22
23
    /**
24
     * Return the callable.
25
     *
26
     * @return callable
27
     */
28
    public function __invoke()
29
    {
30
        return $this->callable->__invoke();
31
    }
32
}
33