| @@ 847-869 (lines=23) @@ | ||
| 844 | } |
|
| 845 | } |
|
| 846 | ||
| 847 | if ( ! function_exists('studly_case')) |
|
| 848 | { |
|
| 849 | /** |
|
| 850 | * Convert a value to studly caps case. |
|
| 851 | * |
|
| 852 | * @param string $value |
|
| 853 | * @return string |
|
| 854 | */ |
|
| 855 | function studly_case($value) |
|
| 856 | { |
|
| 857 | $studlyCache = []; |
|
| 858 | $key = $value; |
|
| 859 | ||
| 860 | if (isset($studlyCache[$key])) |
|
| 861 | { |
|
| 862 | return $studlyCache[$key]; |
|
| 863 | } |
|
| 864 | ||
| 865 | $value = ucwords(str_replace(array('-', '_'), ' ', $value)); |
|
| 866 | ||
| 867 | return $studlyCache[$key] = str_replace(' ', '', $value); |
|
| 868 | } |
|
| 869 | } |
|
| 870 | ||
| 871 | if ( ! function_exists('trait_uses_recursive')) |
|
| 872 | { |
|
| @@ 923-945 (lines=23) @@ | ||
| 920 | /** |
|
| 921 | * Helper functions for the helper functions, that can still be used standalone |
|
| 922 | */ |
|
| 923 | if ( ! function_exists('studly')) |
|
| 924 | { |
|
| 925 | /** |
|
| 926 | * Convert a value to studly caps case. |
|
| 927 | * |
|
| 928 | * @param string $value |
|
| 929 | * @return string |
|
| 930 | */ |
|
| 931 | function studly($value) |
|
| 932 | { |
|
| 933 | $studlyCache = []; |
|
| 934 | $key = $value; |
|
| 935 | ||
| 936 | if (isset($studlyCache[$key])) |
|
| 937 | { |
|
| 938 | return $studlyCache[$key]; |
|
| 939 | } |
|
| 940 | ||
| 941 | $value = ucwords(str_replace(array('-', '_'), ' ', $value)); |
|
| 942 | ||
| 943 | return $studlyCache[$key] = str_replace(' ', '', $value); |
|
| 944 | } |
|
| 945 | } |
|
| 946 | ||
| 947 | if ( ! function_exists('get')) |
|
| 948 | { |
|