Total Complexity | 8 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
15 | trait InflectorTrait |
||
16 | { |
||
17 | protected function getPascalCase(string $string): string |
||
18 | { |
||
19 | return (new Convert($string))->toPascal(); |
||
20 | } |
||
21 | |||
22 | protected function getCamelCase(string $string): string |
||
23 | { |
||
24 | return (new Convert($string))->toCamel(); |
||
25 | } |
||
26 | |||
27 | protected function getSnakeCase(string $string): string |
||
30 | } |
||
31 | |||
32 | protected function getDashCase(string $string): string |
||
33 | { |
||
34 | return (new Convert($string))->toKebab(); |
||
35 | } |
||
36 | |||
37 | protected function getSingularize(string $string): string |
||
38 | { |
||
39 | $singularize = Inflector::singularize($string); |
||
40 | |||
41 | return \is_array($singularize) |
||
42 | ? $singularize[0] |
||
43 | : $singularize; |
||
44 | } |
||
45 | |||
46 | protected function getPluralize(string $string): string |
||
53 | } |
||
54 | } |
||
55 |