| Code Coverage
| Classes and Traits | Functions and Methods | Lines
Total | 0.00% covered (danger) | 0.00% | 0 / 1 | 0.00% covered (danger) | 0.00% | 0 / 1 | CRAP | 85.71% covered (warning) | 85.71% | 6 / 7
InterfacePass | 0.00% covered (danger) | 0.00% | 0 / 1 | 50.00% covered (warning) | 50.00% | 1 / 2 | 2.01 | 85.71% covered (warning) | 85.71% | 6 / 7
apply($code, MockConfiguration $config) | 100.00% covered (success) | 100.00% | 1 / 1 | 1 |  |  |
anonymous function ($code, $i) | 0.00% covered (danger) | 0.00% | 0 / 1 | 1.12 | 50.00% covered (warning) | 50.00% | 1 / 2

1 | <?php
2 |
3 | namespace Mockery\Generator\StringManipulation\Pass;
4 |
5 | use Mockery\Generator\MockConfiguration;
6 |
7 | class InterfacePass implements Pass
8 | {
9 | public function apply($code, MockConfiguration $config)
10 | {
11 | $interfaces = array_reduce((array) $config->getTargetInterfaces(), function ($code, $i) {
12 | return $code . ", \\" . $i->getName();
13 | }, "");
14 |
15 | $code = str_replace(
16 | "implements MockInterface",
17 | "implements MockInterface" . $interfaces,
18 | $code
19 | );
20 |
21 | return $code;
22 | }
23 | }