File tree Expand file tree Collapse file tree 2 files changed +2
-15
lines changed
Expand file tree Collapse file tree 2 files changed +2
-15
lines changed Original file line number Diff line number Diff line change @@ -372,6 +372,7 @@ abstract class Sniff implements PHPCS_Sniff {
372372 \T_INT_CAST => true ,
373373 \T_DOUBLE_CAST => true ,
374374 \T_BOOL_CAST => true ,
375+ \T_UNSET_CAST => true ,
375376 );
376377
377378 /**
Original file line number Diff line number Diff line change @@ -124,20 +124,6 @@ class EscapeOutputSniff extends Sniff {
124124 'PHP_DEBUG ' => true , // Integer.
125125 );
126126
127- /**
128- * List of names of the cast tokens which can be considered as a safe escaping method.
129- *
130- * @since 0.12.0
131- *
132- * @var array
133- */
134- private $ safe_cast_tokens = array (
135- 'T_INT_CAST ' => true , // (int)
136- 'T_DOUBLE_CAST ' => true , // (float)
137- 'T_BOOL_CAST ' => true , // (bool)
138- 'T_UNSET_CAST ' => true , // (unset)
139- );
140-
141127 /**
142128 * List of tokens which can be considered as a safe when directly part of the output.
143129 *
@@ -367,7 +353,7 @@ public function process_token( $stackPtr ) {
367353 $ watch = false ;
368354
369355 // Allow int/double/bool casted variables.
370- if ( isset ( $ this ->safe_cast_tokens [ $ this ->tokens [ $ i ]['type ' ] ] ) ) {
356+ if ( isset ( $ this ->safe_casts [ $ this ->tokens [ $ i ]['code ' ] ] ) ) {
371357 $ in_cast = true ;
372358 continue ;
373359 }
You can’t perform that action at this time.
0 commit comments