Total Complexity | 6 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | class Titlecase extends AbstractRule |
||
15 | { |
||
16 | /** |
||
17 | * Check if the given value must formated in Title case. |
||
18 | * |
||
19 | * @see https://en.wikipedia.org/wiki/Title_case |
||
20 | * @credit <a href="https://github.com/Intervention/validation">Intervention/validation - \Intervention\Validation\Rules\Titlecase</a> |
||
21 | * |
||
22 | * @param mixed $value |
||
23 | */ |
||
24 | public function check($value): bool |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * Get array of words from current value |
||
41 | */ |
||
42 | private function getWords(string $value): array |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * Determine if given word starts with upper case letter or number |
||
49 | */ |
||
50 | private function isValidWord(string $word): bool |
||
55 |