Completed
Push — master ( 87ad62...d12792 )
by Beniamin
03:02
created

InvokeCallback::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
/**
4
 * This file is part of Phuria SQL Builder package.
5
 *
6
 * Copyright (c) 2016 Beniamin Jonatan Šimko
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Phuria\SQLBuilder\DependencyInjection;
13
14
/**
15
 * Fixes a recognition callback by the container.
16
 *
17
 * @author Beniamin Jonatan Šimko <[email protected]>
18
 */
19
class InvokeCallback
20
{
21
    /**
22
     * @var callable
23
     */
24
    private $callback;
25
26
    /**
27
     * @param callable $callback
28
     */
29 1
    public function __construct(callable $callback)
30
    {
31 1
        $this->callback = $callback;
32 1
    }
33
34
    /**
35
     * @return mixed
36
     */
37 1
    public function __invoke()
38
    {
39 1
        return call_user_func_array($this->callback, func_get_args());
40
    }
41
}