File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -672,6 +672,27 @@ public function tokenizeString($string, $eolChar='\n')
672
672
continue ;
673
673
}//end if
674
674
675
+ /*
676
+ HHVM 3.5 and 3.6 tokenizes a hashbang like #!/usr/bin/php
677
+ as T_HASHANG instead of T_INLINE_HTML,so fix that.
678
+ */
679
+
680
+ if ($ tokenIsArray === true
681
+ && token_name ($ token [0 ]) === 'T_HASHBANG '
682
+ ) {
683
+ $ finalTokens [$ newStackPtr ] = array (
684
+ 'content ' => $ token [1 ],
685
+ 'code ' => T_INLINE_HTML ,
686
+ 'type ' => 'T_INLINE_HTML ' ,
687
+ );
688
+ if (PHP_CODESNIFFER_VERBOSITY > 1 ) {
689
+ echo "\t\t* token $ stackPtr changed from T_HASHBANG to T_INLINE_HTML " .PHP_EOL ;
690
+ }
691
+
692
+ $ newStackPtr ++;
693
+ continue ;
694
+ }//end if
695
+
675
696
/*
676
697
If this token has newlines in its content, split each line up
677
698
and create a new token for each line. We do this so it's easier
You can’t perform that action at this time.
0 commit comments