Conditions | 2 |
Paths | 1 |
Total Lines | 8 |
Code Lines | 3 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
15 | 72 | public static function prepend(ProvidesUrl $model, string $slug, $locale): string |
|
16 | { |
||
17 | 72 | $slugWithBaseSegment = $model->baseUrlSegment($locale) . '/' . $slug; |
|
18 | 72 | $slugWithBaseSegment = trim($slugWithBaseSegment, '/'); |
|
19 | |||
20 | // If slug with base segment is empty string, it means that the passed slug was probably a "/" character. |
||
21 | // so we'll want to return it in case the base segment is not added. |
||
22 | 72 | return $slugWithBaseSegment ?: '/'; |
|
23 | } |
||
55 |