File tree Expand file tree Collapse file tree 6 files changed +15
-10
lines changed Expand file tree Collapse file tree 6 files changed +15
-10
lines changed Original file line number Diff line number Diff line change 3838 run : vendor/bin/phpcs --report-full --report-checkstyle=./checkstyle.xml
3939
4040 - name : Show PHPCS results in PR
41- run : cs2pr ./checkstyle.xml --graceful-warnings
41+ run : cs2pr ./checkstyle.xml
4242
4343 - name : Make sure no vardumps remain
4444 run : composer vardumpcheck
Original file line number Diff line number Diff line change 11<?php
2+
23use PHP_Parallel_Lint \PhpConsoleColor \ConsoleColor ;
34use PHP_Parallel_Lint \PhpConsoleHighlighter \Highlighter ;
45
78$ highlighter = new Highlighter (new ConsoleColor ());
89
910$ fileContent = file_get_contents (__FILE__ );
10- echo $ highlighter ->getCodeSnippet ($ fileContent , 3 );
11+ echo $ highlighter ->getCodeSnippet ($ fileContent , 3 );
Original file line number Diff line number Diff line change 11<?php
2+
23use PHP_Parallel_Lint \PhpConsoleColor \ConsoleColor ;
34use PHP_Parallel_Lint \PhpConsoleHighlighter \Highlighter ;
45
78$ highlighter = new Highlighter (new ConsoleColor ());
89
910$ fileContent = file_get_contents (__FILE__ );
10- echo $ highlighter ->getWholeFile ($ fileContent );
11+ echo $ highlighter ->getWholeFile ($ fileContent );
Original file line number Diff line number Diff line change 11<?php
2+
23use PHP_Parallel_Lint \PhpConsoleColor \ConsoleColor ;
34use PHP_Parallel_Lint \PhpConsoleHighlighter \Highlighter ;
45
78$ highlighter = new Highlighter (new ConsoleColor ());
89
910$ fileContent = file_get_contents (__FILE__ );
10- echo $ highlighter ->getWholeFileWithLineNumbers ($ fileContent );
11+ echo $ highlighter ->getWholeFileWithLineNumbers ($ fileContent );
Original file line number Diff line number Diff line change 11<?php
2+
23namespace PHP_Parallel_Lint \PhpConsoleHighlighter ;
34
45use PHP_Parallel_Lint \PhpConsoleColor \ConsoleColor ;
@@ -157,7 +158,6 @@ private function getTokenType($arrayToken)
157158 case T_CLOSE_TAG :
158159 case T_STRING :
159160 case T_VARIABLE :
160-
161161 // Constants
162162 case T_DIR :
163163 case T_FILE :
@@ -183,6 +183,8 @@ private function getTokenType($arrayToken)
183183 return self ::TOKEN_HTML ;
184184 }
185185
186+ // phpcs:disable PHPCompatibility.Constants.NewConstants -- The new token constants are only used when defined.
187+
186188 // Handle PHP >= 8.0 namespaced name tokens.
187189 // https://www.php.net/manual/en/migration80.incompatible.php#migration80.incompatible.tokenizer
188190 if (defined ('T_NAME_QUALIFIED ' ) && $ arrayToken [0 ] === T_NAME_QUALIFIED ) {
@@ -195,6 +197,8 @@ private function getTokenType($arrayToken)
195197 return self ::TOKEN_DEFAULT ;
196198 }
197199
200+ // phpcs:enable
201+
198202 return self ::TOKEN_KEYWORD ;
199203 }
200204
Original file line number Diff line number Diff line change 11<?php
2+
23namespace PHP_Parallel_Lint \PhpConsoleHighlighter \Test ;
34
45use PHP_Parallel_Lint \PhpConsoleHighlighter \Highlighter ;
5-
66use PHPUnit \Framework \TestCase ;
77
88class HighlighterTest extends TestCase
@@ -267,17 +267,15 @@ public function testHashComment()
267267 public function testEmpty ()
268268 {
269269 $ this ->compare (
270- ''
271- ,
270+ '' ,
272271 ''
273272 );
274273 }
275274
276275 public function testWhitespace ()
277276 {
278277 $ this ->compare (
279- ' '
280- ,
278+ ' ' ,
281279 '<token_html> </token_html> '
282280 );
283281 }
You can’t perform that action at this time.
0 commit comments