Completed
Push — master ( a73bb4...b13675 )
by Joshua
27:52 queued 11:19
created

CallableTask   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 24
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A run() 0 5 1
1
<?php
2
3
namespace As3\Bundle\PostProcessBundle\Task;
4
5
/**
6
 * Task for running a callable property.
7
 *
8
 * @author Jacob Bare <[email protected]>
9
 */
10
class CallableTask implements TaskInterface
11
{
12
    /**
13
     * @var callable
14
     */
15
    private $callable;
16
17
    /**
18
     * @param   callable    $callable
19
     */
20
    public function __construct(callable $callable)
21
    {
22
        $this->callable = $callable;
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function run()
29
    {
30
        $callable = $this->callable;
31
        $callable();
32
    }
33
}
34