| Conditions | 3 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 38 | 4 | public function transform($input, array $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( |
|
| 50 | 1 | 'Rule Slugify: Unable to transform input ('.var_export($input, true).')' |
|
| 51 | 1 | ); |
|
| 52 | } |
||
| 53 | |||
| 54 | 2 | return $output; |
|
| 55 | } |
||
| 56 | } |
||
| 57 |