| Conditions | 3 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 38 | 4 | public function transform($input, $arguments) |
|
| 39 | { |
||
| 40 | // I should have two arguments: old format / new format |
||
| 41 | 4 | if (count($arguments) !== 0) { |
|
| 42 | 1 | throw new TransformationException('Rule Slugify Expects no parameter'); |
|
| 43 | } |
||
| 44 | |||
| 45 | try { |
||
| 46 | 3 | $slugify = new CocurSlugify(); |
|
| 47 | 3 | $output = $slugify->slugify($input); |
|
| 48 | 3 | } catch (\Exception $e) { |
|
| 49 | 1 | throw new NotTransformableException("Rule Slugify: Unable to transform input ($input)"); |
|
| 50 | } |
||
| 51 | |||
| 52 | 2 | return $output; |
|
| 53 | } |
||
| 54 | } |
||
| 55 |