| Conditions | 2 |
| Paths | 1 |
| Total Lines | 8 |
| Code Lines | 3 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public static function prepend(ProvidesUrl $model, string $slug, $locale): string |
||
| 16 | { |
||
| 17 | $slugWithBaseSegment = $model->baseUrlSegment($locale) . '/' . $slug; |
||
| 18 | $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 | return $slugWithBaseSegment ?: '/'; |
||
| 23 | } |
||
| 55 |