Total Complexity | 5 |
Total Lines | 26 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
5 | class LiteralReturn extends Handler |
||
6 | { |
||
7 | public function handle(): bool |
||
8 | { |
||
9 | if (!$this->canHandle()) { |
||
10 | return false; |
||
11 | } |
||
12 | |||
13 | $this->initialStub |
||
14 | ->method($this->methodName) |
||
15 | ->willReturn($this->returnLiteral()); |
||
16 | |||
17 | return true; |
||
18 | } |
||
19 | |||
20 | private function canHandle(): bool |
||
21 | { |
||
22 | return is_string($this->methodMockConfig) |
||
23 | && substr($this->methodMockConfig, 0, 9) === '@literal:'; |
||
24 | } |
||
25 | |||
26 | private function returnLiteral() |
||
31 | } |
||
32 | } |
||
33 |