GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — develop ( 50cef7...02ca20 )
by Rolf
01:54
created

Closure::_execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
namespace izzum\command;
3
use izzum\command\Command;
4
5
/**
6
 * A Closure command allows the use of closure in a (composite) command.
7
 *
8
 * This allows clients of a Command to inject logic by means of an anonymous
9
 * function.
10
 *
11
 * This provides the flexibility to use custom logic in a command without
12
 * subclassing a command, while still allowing the use of the command library.
13
 *
14
 * eg: $command = new Closure(function() {echo "hello world";});
15
 * $command->execute();//echoes 'hello world'
16
 *
17
 * @author Rolf Vreijdenberger
18
 */
19
class Closure extends Command {
20
    /**
21
     *
22
     * @var \Closure
23
     */
24
    private $closure;
25
    
26
    /**
27
     * an array of arguments to pass as parameters to the closure
28
     * 
29
     * @var mixed[]
30
     */
31
    private $arguments;
32
33
    /**
34
     *
35
     * @param Closure $closure            
36
     * @param array $arguments
37
     *            an optional array of arguments to pass to the closure
38
     */
39 2
    public function __construct(\Closure $closure, $arguments = array())
40
    {
41 2
        $this->closure = $closure;
42 2
        $this->arguments = $arguments;
43 2
    }
44
45 2
    protected function _execute()
46
    {
47 2
        call_user_func_array($this->closure, $this->arguments);
48
    }
49
}