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

ConsecutiveCallsReturn::canHandle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
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