Completed
Push — master ( b4617e...2ff698 )
by Dave
22:59 queued 17:34
created

HigherOrderMessage::__call()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 0
cts 5
cp 0
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 2
crap 6
1
<?php
2
3
namespace Mockery;
4
5
class HigherOrderMessage 
6
{
7
    private $mock;
8
    private $method;
9
10
    public function __construct(MockInterface $mock, $method)
11
    {
12
        $this->mock = $mock;
13
        $this->method = $method;
14
    }
15
16
    /**
17
     * @return Mockery\Expectation
18
     */
19
    public function __call($method, $args)
20
    {
21
        $expectation = $this->mock->{$this->method}($method);
22
23
        if ($this->method !== "shouldNotHaveReceived") {
24
            return $expectation->withArgs($args);
25
        }
26
27
        return $expectation;
28
    }
29
}
30