Test Setup Failed
Branch master (10fdc5)
by Beniamin
35:44
created

InvokeCallback   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 23
c 0
b 0
f 0
wmc 2
lcom 0
cbo 0
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\UnderQuery\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
    public function __construct(callable $callback)
30
    {
31
        $this->callback = $callback;
32
    }
33
34
    /**
35
     * @return mixed
36
     */
37
    public function __invoke()
38
    {
39
        return call_user_func_array($this->callback, func_get_args());
40
    }
41
}