Completed
Pull Request — master (#668)
by Dave
02:37
created

HigherOrderMessage   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 88.89%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 25
ccs 8
cts 9
cp 0.8889
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A __call() 0 10 2
1
<?php
2
3
namespace Mockery;
4
5
class HigherOrderMessage 
6
{
7
    private $mock;
8
    private $method;
9
10 2
    public function __construct(MockInterface $mock, $method)
11
    {
12 2
        $this->mock = $mock;
13 2
        $this->method = $method;
14 2
    }
15
16
    /**
17
     * @return Mockery\Expectation
18
     */
19 2
    public function __call($method, $args)
20
    {
21 2
        $expectation = $this->mock->{$this->method}($method);
22
23 2
        if ($this->method !== "shouldNotHaveReceived") {
24 2
            return $expectation->withArgs($args);
25
        }
26
27
        return $expectation;
28
    }
29
}
30