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

ClosureWrapper   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

2 Methods

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