Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 12 |
Ratio | 100 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
48 | 1 | View Code Duplication | protected function doDecorate($mock, StubSet $stubs) |
1 ignored issue
–
show
|
|||
49 | { |
||
50 | /** @var Stub $stub */ |
||
51 | 1 | foreach ($stubs as $stub) { |
|
52 | 1 | $methodValue = $stub->getMethodValue(); |
|
53 | |||
54 | 1 | $partial = $mock->{$stub->getMethodName()}(new NoPriorityToken()); |
|
55 | 1 | $methodValue instanceof \Throwable |
|
56 | 1 | ? $partial->willThrow($methodValue) |
|
57 | 1 | : $partial->willReturn($methodValue); |
|
58 | } |
||
59 | } |
||
60 | |||
81 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.