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

InvokeCallback   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 23
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __invoke() 0 4 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
}