| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 71 | private function sluggable($title, $separator = '-') |
||
| 72 | { |
||
| 73 | $flip = $separator == '-' ? '_' : '-'; |
||
| 74 | |||
| 75 | $title = preg_replace('!['.preg_quote($flip).']+!u', $separator, $title); |
||
| 76 | |||
| 77 | $title = preg_replace('![^'.preg_quote($separator).'\pL\pN\s]+!u', '', mb_strtolower($title)); |
||
| 78 | |||
| 79 | $title = preg_replace('!['.preg_quote($separator).'\s]+!u', $separator, $title); |
||
| 80 | |||
| 81 | return trim($title, $separator); |
||
| 82 | } |
||
| 83 | } |
||
| 84 |