File tree 6 files changed +15
-10
lines changed
6 files changed +15
-10
lines changed Original file line number Diff line number Diff line change 38
38
run : vendor/bin/phpcs --report-full --report-checkstyle=./checkstyle.xml
39
39
40
40
- name : Show PHPCS results in PR
41
- run : cs2pr ./checkstyle.xml --graceful-warnings
41
+ run : cs2pr ./checkstyle.xml
42
42
43
43
- name : Make sure no vardumps remain
44
44
run : composer vardumpcheck
Original file line number Diff line number Diff line change 1
1
<?php
2
+
2
3
use PHP_Parallel_Lint \PhpConsoleColor \ConsoleColor ;
3
4
use PHP_Parallel_Lint \PhpConsoleHighlighter \Highlighter ;
4
5
7
8
$ highlighter = new Highlighter (new ConsoleColor ());
8
9
9
10
$ 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 1
1
<?php
2
+
2
3
use PHP_Parallel_Lint \PhpConsoleColor \ConsoleColor ;
3
4
use PHP_Parallel_Lint \PhpConsoleHighlighter \Highlighter ;
4
5
7
8
$ highlighter = new Highlighter (new ConsoleColor ());
8
9
9
10
$ 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 1
1
<?php
2
+
2
3
use PHP_Parallel_Lint \PhpConsoleColor \ConsoleColor ;
3
4
use PHP_Parallel_Lint \PhpConsoleHighlighter \Highlighter ;
4
5
7
8
$ highlighter = new Highlighter (new ConsoleColor ());
8
9
9
10
$ 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 1
1
<?php
2
+
2
3
namespace PHP_Parallel_Lint \PhpConsoleHighlighter ;
3
4
4
5
use PHP_Parallel_Lint \PhpConsoleColor \ConsoleColor ;
@@ -157,7 +158,6 @@ private function getTokenType($arrayToken)
157
158
case T_CLOSE_TAG :
158
159
case T_STRING :
159
160
case T_VARIABLE :
160
-
161
161
// Constants
162
162
case T_DIR :
163
163
case T_FILE :
@@ -183,6 +183,8 @@ private function getTokenType($arrayToken)
183
183
return self ::TOKEN_HTML ;
184
184
}
185
185
186
+ // phpcs:disable PHPCompatibility.Constants.NewConstants -- The new token constants are only used when defined.
187
+
186
188
// Handle PHP >= 8.0 namespaced name tokens.
187
189
// https://www.php.net/manual/en/migration80.incompatible.php#migration80.incompatible.tokenizer
188
190
if (defined ('T_NAME_QUALIFIED ' ) && $ arrayToken [0 ] === T_NAME_QUALIFIED ) {
@@ -195,6 +197,8 @@ private function getTokenType($arrayToken)
195
197
return self ::TOKEN_DEFAULT ;
196
198
}
197
199
200
+ // phpcs:enable
201
+
198
202
return self ::TOKEN_KEYWORD ;
199
203
}
200
204
Original file line number Diff line number Diff line change 1
1
<?php
2
+
2
3
namespace PHP_Parallel_Lint \PhpConsoleHighlighter \Test ;
3
4
4
5
use PHP_Parallel_Lint \PhpConsoleHighlighter \Highlighter ;
5
-
6
6
use PHPUnit \Framework \TestCase ;
7
7
8
8
class HighlighterTest extends TestCase
@@ -267,17 +267,15 @@ public function testHashComment()
267
267
public function testEmpty ()
268
268
{
269
269
$ this ->compare (
270
- ''
271
- ,
270
+ '' ,
272
271
''
273
272
);
274
273
}
275
274
276
275
public function testWhitespace ()
277
276
{
278
277
$ this ->compare (
279
- ' '
280
- ,
278
+ ' ' ,
281
279
'<token_html> </token_html> '
282
280
);
283
281
}
You can’t perform that action at this time.
0 commit comments