Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
CRAP | |
85.71% |
6 / 7 |
InterfacePass | |
0.00% |
0 / 1 |
|
50.00% |
1 / 2 |
2.01 | |
85.71% |
6 / 7 |
apply | |
100.00% |
1 / 1 |
1 | ||||||
anonymous function | |
0.00% |
0 / 1 |
1.12 | |
50.00% |
1 / 2 |
<?php | |
namespace Mockery\Generator\StringManipulation\Pass; | |
use Mockery\Generator\MockConfiguration; | |
class InterfacePass implements Pass | |
{ | |
public function apply($code, MockConfiguration $config) | |
{ | |
$interfaces = array_reduce((array) $config->getTargetInterfaces(), function ($code, $i) { | |
return $code . ", \\" . $i->getName(); | |
}, ""); | |
$code = str_replace( | |
"implements MockInterface", | |
"implements MockInterface" . $interfaces, | |
$code | |
); | |
return $code; | |
} | |
} |