| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | public function apply($code, MockConfiguration $config) |
||
| 30 | { |
||
| 31 | 397 | $names = array_map(function ($method) { |
|
| 32 | 109 | return $method->getName(); |
|
| 33 | 397 | }, $config->getMethodsToMock()); |
|
| 34 | |||
| 35 | 397 | foreach (["allows", "expects"] as $method) { |
|
| 36 | 397 | if (in_array($method, $names)) { |
|
| 37 | 2 | $code = preg_replace( |
|
| 38 | 2 | "#// start method {$method}.*// end method {$method}#ms", |
|
| 39 | 2 | "", |
|
| 40 | $code |
||
| 41 | 2 | ); |
|
| 42 | 2 | } |
|
| 43 | 397 | } |
|
| 44 | |||
| 45 | 397 | return $code; |
|
| 46 | } |
||
| 47 | } |
||
| 48 |