Completed
Pull Request — master (#712)
by Dave
02:48
created

ClosureWrapper::__construct()   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 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Mockery
5
 *
6
 * LICENSE
7
 *
8
 * This source file is subject to the new BSD license that is bundled
9
 * with this package in the file LICENSE.txt.
10
 * It is also available through the world-wide-web at this URL:
11
 * http://github.com/padraic/mockery/blob/master/LICENSE
12
 * If you did not receive a copy of the license and are unable to
13
 * obtain it through the world-wide-web, please send an email
14
 * to [email protected] so we can send you a copy immediately.
15
 *
16
 * @category   Mockery
17
 * @package    Mockery
18
 * @copyright  Copyright (c) 2017 Dave Marshall https://github.com/davedevelopment
19
 * @license    http://github.com/padraic/mockery/blob/master/LICENSE New BSD License
20
 */
21
22
namespace Mockery;
23
24
use Mockery\Matcher\Closure;
25
26
/**
27
 * @internal
28
 */
29
class ClosureWrapper
30
{
31
    private $closure;
32
33 16
    public function __construct(\Closure $closure)
34
    {
35 16
        $this->closure = $closure;
36 16
    }
37
38 14
    public function __invoke()
39
    {
40 14
        return call_user_func_array($this->closure, func_get_args());
41
    }
42
}
43