1 | <?php |
||
23 | class CamelCaseVariableSniff extends AbstractSniff |
||
24 | { |
||
25 | use VariableRegistrationTrait; |
||
26 | |||
27 | /** |
||
28 | * The error code for this sniff. |
||
29 | * |
||
30 | * @var string |
||
31 | */ |
||
32 | public const CODE_NOT_CAMEL_CASE = 'NotCamelCase'; |
||
33 | |||
34 | /** |
||
35 | * The error message for this sniff. |
||
36 | * |
||
37 | * @var string |
||
38 | */ |
||
39 | private const MESSAGE_NOT_CAMEL_CASE = 'Variable %s should be in camelCase (lowercase first).'; |
||
40 | |||
41 | /** |
||
42 | * The previously sniffed file. |
||
43 | * |
||
44 | * @var string |
||
45 | */ |
||
46 | private $prevSniffedFile = ''; |
||
47 | |||
48 | /** |
||
49 | * The vars which were sniffed in this file. |
||
50 | * |
||
51 | * @var array |
||
52 | */ |
||
53 | private $sniffedVars = []; |
||
54 | |||
55 | /** |
||
56 | * Returns true if there is a value assignment or a property declaration, but which can be without an assignment. |
||
57 | * |
||
58 | * @return bool |
||
59 | */ |
||
60 | protected function areRequirementsMet(): bool |
||
79 | |||
80 | /** |
||
81 | * Processes the token. |
||
82 | * |
||
83 | * @see self::setUp() |
||
84 | * |
||
85 | * @return void |
||
86 | */ |
||
87 | protected function processToken(): void |
||
107 | |||
108 | /** |
||
109 | * Sets up the sniff. |
||
110 | * |
||
111 | * @return void |
||
112 | */ |
||
113 | protected function setUp(): void |
||
124 | |||
125 | /** |
||
126 | * Cleans the cache of this sniff. |
||
127 | * |
||
128 | * @return void |
||
129 | */ |
||
130 | protected function tearDown(): void |
||
139 | } |
||
140 |