This repository was archived by the owner on Dec 1, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ abstract class LineLinter<+Terror as LineLintError> extends SingleRuleLinter {
37
37
}
38
38
39
39
// We got an error. Let's check the previous line to see if it is marked as ignorable
40
- if ($ln - 1 >= 0 && $this -> isLinterSuppressed( $ln )) {
40
+ if ($ln - 1 >= 0 && $this -> isSuppressedForLine( $this -> getFile(), $ln )) {
41
41
continue ;
42
42
}
43
43
@@ -47,17 +47,6 @@ abstract class LineLinter<+Terror as LineLintError> extends SingleRuleLinter {
47
47
return $errs ;
48
48
}
49
49
50
- /* * Check if this linter has been disabled by a comment on the previous line.
51
- */
52
- private function isLinterSuppressed (int $base1_line_number ): bool {
53
- $line_marker = $this -> getFile()-> lintMarkersForLineBasedSuppression();
54
- return (
55
- $line_marker [$this -> getFixmeMarker()][$base1_line_number ] ??
56
- $line_marker [$this -> getIgnoreSingleErrorMarker()][$base1_line_number ] ??
57
- null
58
- ) is nonnull ;
59
- }
60
-
61
50
/* * Parse a single line of code and attempts to find lint errors */
62
51
abstract public function getLintErrorsForLine (
63
52
string $line ,
Original file line number Diff line number Diff line change @@ -60,4 +60,15 @@ trait SuppressibleTrait {
60
60
);
61
61
}
62
62
63
+ /* * Check if this linter has been disabled by a comment on the previous line.
64
+ */
65
+ public final function isSuppressedForLine (File $file , int $previous_line_number ): bool {
66
+ $line_marker = $file -> lintMarkersForLineBasedSuppression();
67
+ return (
68
+ $line_marker [$this -> getFixmeMarker()][$previous_line_number ] ??
69
+ $line_marker [$this -> getIgnoreSingleErrorMarker()][$previous_line_number ] ??
70
+ null
71
+ ) is nonnull ;
72
+ }
73
+
63
74
}
You can’t perform that action at this time.
0 commit comments