| @@ 72-80 (lines=9) @@ | ||
| 69 | echo Template::instance()->render($layout, $mime); |
|
| 70 | } |
|
| 71 | ||
| 72 | function str_contains($haystack, $needles) |
|
| 73 | { |
|
| 74 | foreach ((array) $needles as $needle) { |
|
| 75 | if ($needle != '' && mb_strpos($haystack, $needle) !== false) { |
|
| 76 | return true; |
|
| 77 | } |
|
| 78 | } |
|
| 79 | return false; |
|
| 80 | } |
|
| 81 | function extension($file, $default = 'json') |
|
| 82 | { |
|
| 83 | return $file.'.'.(pathinfo($file, PATHINFO_EXTENSION) ?: $default); |
|
| @@ 39-47 (lines=9) @@ | ||
| 36 | return false; |
|
| 37 | } |
|
| 38 | ||
| 39 | public static function endsWith($haystack, $needles) |
|
| 40 | { |
|
| 41 | foreach ((array) $needles as $needle) { |
|
| 42 | if (substr($haystack, -strlen($needle)) === (string) $needle) { |
|
| 43 | return true; |
|
| 44 | } |
|
| 45 | } |
|
| 46 | ||
| 47 | return false; |
|
| 48 | } |
|
| 49 | ||
| 50 | public static function finish($value, $cap) |
|
| @@ 230-238 (lines=9) @@ | ||
| 227 | return static::$snakeCache[$key][$delimiter] = $value; |
|
| 228 | } |
|
| 229 | ||
| 230 | public static function startsWith($haystack, $needles) |
|
| 231 | { |
|
| 232 | foreach ((array) $needles as $needle) { |
|
| 233 | if ($needle !== '' && substr($haystack, 0, strlen($needle)) === (string) $needle) { |
|
| 234 | return true; |
|
| 235 | } |
|
| 236 | } |
|
| 237 | ||
| 238 | return false; |
|
| 239 | } |
|
| 240 | ||
| 241 | public static function studly($value) |
|