1 | <?php |
||
20 | class StringHelper |
||
21 | { |
||
22 | |||
23 | const PREPOSITIONS = [ |
||
24 | 'on', 'in', 'at', 'since', 'for', 'ago', 'before', 'to', 'past', 'till', 'until', 'by', 'under', 'below', 'over', |
||
25 | 'above', 'across', 'through', 'into', 'towards', 'onto', 'from', 'of', 'off', 'about', 'via' |
||
26 | ]; |
||
27 | |||
28 | const ARTICLES = [ |
||
29 | 'a', 'an', 'the' |
||
30 | ]; |
||
31 | |||
32 | const ADVERBS = [ |
||
33 | 'yet', 'so', 'just', 'only' |
||
34 | ]; |
||
35 | |||
36 | const CONJUNCTIONS = [ |
||
37 | 'nor', 'so', 'and', 'or' |
||
38 | ]; |
||
39 | |||
40 | const ADJECTIVES = [ |
||
41 | 'down', 'up' |
||
42 | ]; |
||
43 | |||
44 | const ISO_ENCODINGS = [ |
||
45 | 'ISO-8859-1', |
||
46 | 'ISO-8859-2', |
||
47 | 'ISO-8859-3', |
||
48 | 'ISO-8859-4', |
||
49 | 'ISO-8859-5', |
||
50 | 'ISO-8859-6', |
||
51 | 'ISO-8859-7', |
||
52 | 'ISO-8859-8', |
||
53 | 'ISO-8859-9', |
||
54 | 'ISO-8859-10', |
||
55 | 'ISO-8859-11', |
||
56 | 'ISO-8859-13', |
||
57 | 'ISO-8859-14', |
||
58 | 'ISO-8859-15', |
||
59 | 'ISO-8859-16' |
||
60 | ]; |
||
61 | |||
62 | |||
63 | public static function capitalizeAll($text) |
||
73 | |||
74 | public static function capitalizeForTitle($titleString) |
||
96 | |||
97 | public static function keepLowerCase($word) |
||
106 | |||
107 | public static function mb_ucfirst($string, $encoding = 'UTF-8') |
||
116 | |||
117 | public static function initializeBySpaceOrHyphen($string, $initializeSign) |
||
134 | |||
135 | public static function camelCase2Hyphen($string) |
||
141 | |||
142 | public static function checkLowerCaseString($string) |
||
146 | |||
147 | public static function checkUpperCaseString($string) |
||
151 | |||
152 | } |
This check looks for accesses to local static members using the fully qualified name instead of
self::
.While this is perfectly valid, the fully qualified name of
Certificate::TRIPLEDES_CBC
could just as well be replaced byself::TRIPLEDES_CBC
. Referencing local members withself::
assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.