| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | private function slugify_th($string, $separator) |
||
| 19 | { |
||
| 20 | $string = trim($string); |
||
| 21 | $string = mb_strtolower($string, 'UTF-8'); |
||
| 22 | |||
| 23 | // Make alphanumeric (removes all other characters) |
||
| 24 | // this makes the string safe especially when used as a part of a URL |
||
| 25 | // this keeps latin characters and Persian characters as well |
||
| 26 | $string = preg_replace("/[^a-z0-9_\s-ๅภถุึคตจขชๆไำพะัีรนยบลฃฟหกดเ้่าสวงผปแอิืทมใฝูฎฑธ๊ณญฐฅฤฆฏโฌ็๋ษศซฉฮ์ฒฬฦ]/u", '', $string); |
||
| 27 | |||
| 28 | // Remove multiple dashes or whitespaces or underscores |
||
| 29 | $string = preg_replace("/[\s-_]+/", ' ', $string); |
||
| 30 | |||
| 31 | // Convert whitespaces and underscore to the given separator |
||
| 32 | $string = preg_replace("/[\s_]/", $separator, $string); |
||
| 33 | |||
| 34 | return $string; |
||
| 35 | } |
||
| 43 | } |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.