1 | <?php |
||
7 | class WhitespaceFormatter extends SpecializedFormatter { |
||
|
|||
8 | |||
9 | private static $BLOCK_CONTEXT_MAPPING = [ |
||
10 | T_IF => 'ifelse', |
||
11 | T_ELSEIF => 'ifelse', |
||
12 | T_WHILE => 'while', |
||
13 | T_FOREACH => 'foreach', |
||
14 | T_FOR => 'for', |
||
15 | T_CATCH => 'catch' |
||
16 | ]; |
||
17 | |||
18 | private static $SYNTAX = [ |
||
19 | ')' => 'close', |
||
20 | '(' => 'open', |
||
21 | ',' => 'comma', |
||
22 | ';' => 'semicolon', |
||
23 | ':' => 'colon', |
||
24 | '=>' => 'arrow', |
||
25 | '->' => 'arrow', // function invocation |
||
26 | '::' => 'doublecolon', // function invocation |
||
27 | '?' => 'questionmark' |
||
28 | ]; |
||
29 | |||
30 | protected function doVisitToken(Token $token) { |
||
38 | |||
39 | private function applyKeywords(Token $token) { |
||
44 | |||
45 | private function applyAssignments(Token $token) { |
||
50 | |||
51 | private function applyOperators(Token $token) { |
||
56 | |||
57 | private function applyPrefixPostfix(Token $token) { |
||
70 | |||
71 | /** |
||
72 | * @TODO |
||
73 | * @param Token $token |
||
74 | */ |
||
75 | private function applyUnary(Token $token) { |
||
78 | |||
79 | private function applySyntax(Token $token) { |
||
94 | |||
95 | private function findContext(Token $token) { |
||
128 | |||
129 | private function whitespaceBeforeAfter($key, $context = 'default') { |
||
138 | |||
139 | } |
||
140 |
This check marks property names that have not been written in camelCase.
In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes
databaseConnectionString
.