| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 36 | 5 | public function transform($input, array $arguments) |
|
| 37 | { |
||
| 38 | // I should have two arguments: old format / new format |
||
| 39 | 5 | if (count($arguments) !== 2) { |
|
| 40 | 2 | throw new TransformationException('Rule Replace Expects exactly 2 arguments'); |
|
| 41 | } |
||
| 42 | |||
| 43 | // Transform it |
||
| 44 | 3 | $output = str_replace($arguments[0], $arguments[1], $input); |
|
| 45 | |||
| 46 | 3 | return $output; |
|
| 47 | } |
||
| 48 | } |
||
| 49 |