@@ -54,7 +54,7 @@ protected function scan()
54
54
/*
55
55
* MACRO creation
56
56
*/
57
- $ MACRO_TOKEN_ADVANCE = function () use (&$ tokens , &$ tokenIndex , &$ token , &$ tokenContent , &$ tokenLine ) {
57
+ $ macroTokenAdvance = function () use (&$ tokens , &$ tokenIndex , &$ token , &$ tokenContent , &$ tokenLine ) {
58
58
$ tokenIndex = ($ tokenIndex === null ) ? 0 : $ tokenIndex + 1 ;
59
59
if (!isset ($ tokens [$ tokenIndex ])) {
60
60
$ token = false ;
@@ -79,15 +79,15 @@ protected function scan()
79
79
80
80
return $ tokenIndex ;
81
81
};
82
- $ MACRO_TOKEN_LOGICAL_START_INDEX = function () use (&$ tokenIndex , &$ docCommentIndex ) {
82
+ $ macroTokenLogicalStartIndex = function () use (&$ tokenIndex , &$ docCommentIndex ) {
83
83
return ($ docCommentIndex === false ) ? $ tokenIndex : $ docCommentIndex ;
84
84
};
85
- $ MACRO_DOC_COMMENT_START = function () use (&$ tokenIndex , &$ docCommentIndex ) {
85
+ $ macroDocCommentStart = function () use (&$ tokenIndex , &$ docCommentIndex ) {
86
86
$ docCommentIndex = $ tokenIndex ;
87
87
88
88
return $ docCommentIndex ;
89
89
};
90
- $ MACRO_DOC_COMMENT_VALIDATE = function () use (&$ docCommentIndex ) {
90
+ $ macroDocCommentValidate = function () use (&$ docCommentIndex ) {
91
91
static $ validTrailingTokens = null ;
92
92
if ($ validTrailingTokens === null ) {
93
93
$ validTrailingTokens = [T_WHITESPACE , T_FINAL , T_ABSTRACT , T_INTERFACE , T_CLASS , T_FUNCTION ];
@@ -98,7 +98,7 @@ protected function scan()
98
98
99
99
return $ docCommentIndex ;
100
100
};
101
- $ MACRO_INFO_ADVANCE = function () use (&$ infoIndex , &$ infos , &$ tokenIndex , &$ tokenLine ) {
101
+ $ macroInfoAdvance = function () use (&$ infoIndex , &$ infos , &$ tokenIndex , &$ tokenLine ) {
102
102
$ infos [$ infoIndex ]['tokenEnd ' ] = $ tokenIndex ;
103
103
$ infos [$ infoIndex ]['lineEnd ' ] = $ tokenLine ;
104
104
$ infoIndex ++;
@@ -111,7 +111,7 @@ protected function scan()
111
111
*/
112
112
113
113
// Initialize token
114
- $ MACRO_TOKEN_ADVANCE ();
114
+ $ macroTokenAdvance ();
115
115
116
116
SCANNER_TOP :
117
117
@@ -120,26 +120,26 @@ protected function scan()
120
120
}
121
121
122
122
// Validate current doc comment index
123
- $ MACRO_DOC_COMMENT_VALIDATE ();
123
+ $ macroDocCommentValidate ();
124
124
125
125
switch ($ this ->tokenType ) {
126
126
case T_DOC_COMMENT :
127
- $ MACRO_DOC_COMMENT_START ();
127
+ $ macroDocCommentStart ();
128
128
goto SCANNER_CONTINUE ;
129
129
//goto no break needed
130
130
131
131
case T_NAMESPACE :
132
132
$ infos [$ infoIndex ] = [
133
133
'type ' => 'namespace ' ,
134
- 'tokenStart ' => $ MACRO_TOKEN_LOGICAL_START_INDEX (),
134
+ 'tokenStart ' => $ macroTokenLogicalStartIndex (),
135
135
'tokenEnd ' => null ,
136
136
'lineStart ' => $ token [2 ],
137
137
'lineEnd ' => null ,
138
138
'namespace ' => null ,
139
139
];
140
140
141
141
// start processing with next token
142
- if ($ MACRO_TOKEN_ADVANCE () === false ) {
142
+ if ($ macroTokenAdvance () === false ) {
143
143
goto SCANNER_END ;
144
144
}
145
145
@@ -159,7 +159,7 @@ protected function scan()
159
159
160
160
SCANNER_NAMESPACE_CONTINUE :
161
161
162
- if ($ MACRO_TOKEN_ADVANCE () === false ) {
162
+ if ($ macroTokenAdvance () === false ) {
163
163
goto SCANNER_END ;
164
164
}
165
165
goto SCANNER_NAMESPACE_TOP ;
@@ -168,14 +168,14 @@ protected function scan()
168
168
169
169
$ namespace = $ infos [$ infoIndex ]['namespace ' ];
170
170
171
- $ MACRO_INFO_ADVANCE ();
171
+ $ macroInfoAdvance ();
172
172
goto SCANNER_CONTINUE ;
173
173
//goto no break needed
174
174
175
175
case T_USE :
176
176
$ infos [$ infoIndex ] = [
177
177
'type ' => 'use ' ,
178
- 'tokenStart ' => $ MACRO_TOKEN_LOGICAL_START_INDEX (),
178
+ 'tokenStart ' => $ macroTokenLogicalStartIndex (),
179
179
'tokenEnd ' => null ,
180
180
'lineStart ' => $ tokens [$ tokenIndex ][2 ],
181
181
'lineEnd ' => null ,
@@ -187,7 +187,7 @@ protected function scan()
187
187
$ useAsContext = false ;
188
188
189
189
// start processing with next token
190
- if ($ MACRO_TOKEN_ADVANCE () === false ) {
190
+ if ($ macroTokenAdvance () === false ) {
191
191
goto SCANNER_END ;
192
192
}
193
193
@@ -221,14 +221,14 @@ protected function scan()
221
221
222
222
SCANNER_USE_CONTINUE :
223
223
224
- if ($ MACRO_TOKEN_ADVANCE () === false ) {
224
+ if ($ macroTokenAdvance () === false ) {
225
225
goto SCANNER_END ;
226
226
}
227
227
goto SCANNER_USE_TOP ;
228
228
229
229
SCANNER_USE_END :
230
230
231
- $ MACRO_INFO_ADVANCE ();
231
+ $ macroInfoAdvance ();
232
232
goto SCANNER_CONTINUE ;
233
233
//goto no break needed
234
234
@@ -246,7 +246,7 @@ protected function scan()
246
246
247
247
$ infos [$ infoIndex ] = [
248
248
'type ' => 'include ' ,
249
- 'tokenStart ' => $ MACRO_TOKEN_LOGICAL_START_INDEX (),
249
+ 'tokenStart ' => $ macroTokenLogicalStartIndex (),
250
250
'tokenEnd ' => null ,
251
251
'lineStart ' => $ tokens [$ tokenIndex ][2 ],
252
252
'lineEnd ' => null ,
@@ -255,7 +255,7 @@ protected function scan()
255
255
];
256
256
257
257
// start processing with next token
258
- if ($ MACRO_TOKEN_ADVANCE () === false ) {
258
+ if ($ macroTokenAdvance () === false ) {
259
259
goto SCANNER_END ;
260
260
}
261
261
@@ -269,14 +269,14 @@ protected function scan()
269
269
270
270
SCANNER_INCLUDE_CONTINUE :
271
271
272
- if ($ MACRO_TOKEN_ADVANCE () === false ) {
272
+ if ($ macroTokenAdvance () === false ) {
273
273
goto SCANNER_END ;
274
274
}
275
275
goto SCANNER_INCLUDE_TOP ;
276
276
277
277
SCANNER_INCLUDE_END :
278
278
279
- $ MACRO_INFO_ADVANCE ();
279
+ $ macroInfoAdvance ();
280
280
goto SCANNER_CONTINUE ;
281
281
//goto no break needed
282
282
@@ -288,7 +288,7 @@ protected function scan()
288
288
case T_TRAIT :
289
289
$ infos [$ infoIndex ] = [
290
290
'type ' => ($ this ->tokenType === T_FUNCTION ) ? 'function ' : 'class ' ,
291
- 'tokenStart ' => $ MACRO_TOKEN_LOGICAL_START_INDEX (),
291
+ 'tokenStart ' => $ macroTokenLogicalStartIndex (),
292
292
'tokenEnd ' => null ,
293
293
'lineStart ' => $ tokens [$ tokenIndex ][2 ],
294
294
'lineEnd ' => null ,
@@ -333,20 +333,20 @@ protected function scan()
333
333
334
334
SCANNER_CLASS_CONTINUE :
335
335
336
- if ($ MACRO_TOKEN_ADVANCE () === false ) {
336
+ if ($ macroTokenAdvance () === false ) {
337
337
goto SCANNER_END ;
338
338
}
339
339
goto SCANNER_CLASS_TOP ;
340
340
341
341
SCANNER_CLASS_END :
342
342
343
- $ MACRO_INFO_ADVANCE ();
343
+ $ macroInfoAdvance ();
344
344
goto SCANNER_CONTINUE ;
345
345
}
346
346
347
347
SCANNER_CONTINUE :
348
348
349
- if ($ MACRO_TOKEN_ADVANCE () === false ) {
349
+ if ($ macroTokenAdvance () === false ) {
350
350
goto SCANNER_END ;
351
351
}
352
352
goto SCANNER_TOP ;
0 commit comments