CallbackCommand::execute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * Spiral, Core Components
4
 *
5
 * @author Wolfy-J
6
 */
7
8
namespace Spiral\ORM\Commands;
9
10
class CallbackCommand extends AbstractCommand
11
{
12
    /**
13
     * @var \Closure
14
     */
15
    private $callback;
16
17
    /**
18
     * @param \Closure $callback
19
     */
20
    public function __construct(\Closure $callback)
21
    {
22
        $this->callback = $callback;
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function execute()
29
    {
30
        call_user_func($this->callback);
31
        parent::execute();
32
    }
33
}