Completed
Push — master ( e1eaf9...3b6dfb )
by Thanos
01:48
created

ConsecutiveCallsReturn   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 18
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A canHandle() 0 3 1
A handle() 0 11 2
1
<?php
2
3
namespace Amock\MockMethod;
4
5
class ConsecutiveCallsReturn extends Handler
6
{
7
    public function handle(): bool
8
    {
9
        if (!$this->canHandle()) {
10
            return false;
11
        }
12
13
        $this->initialStub->method($this->methodName)->will(
14
            call_user_func_array([$this->testCase, 'onConsecutiveCalls'], $this->methodMockConfig)
15
        );
16
17
        return true;
18
    }
19
20
    private function canHandle(): bool
21
    {
22
        return is_array($this->methodMockConfig);
23
    }
24
}
25