@@ -60,41 +60,14 @@ trait LinterTrait {
60
60
|> Str \strip_suffix ($$, ' Linter' );
61
61
}
62
62
63
- /**
64
- * A user can choose to ignore all errors reported by this linter for a
65
- * whole file using this string as a marker
66
- */
67
- public function getIgnoreAllMarker (): string {
68
- return LintMarkerName :: HHAST_IGNORE_ALL . ' [' . $this -> getLinterName(). ' ]' ;
63
+ public final function getErrorCode (): string {
64
+ return $this -> getLinterName();
69
65
}
70
66
71
- /**
72
- * A user can choose to ignore a specific error reported by this linter
73
- * using this string as a marker
74
- */
75
- public function getIgnoreSingleErrorMarker (): string {
76
- return LintMarkerName :: HHAST_IGNORE_ERROR . ' [' . $this -> getLinterName(). ' ]' ;
77
- }
78
-
79
- /**
80
- * A user can choose to ignore a specific error reported by this linter
81
- * using this string as a marker.
82
- *
83
- * The difference to HHAST_IGNORE_ERROR is that we expect this one to be
84
- * fixed.
85
- */
86
- public function getFixmeMarker (): string {
87
- return LintMarkerName :: HHAST_FIXME . ' [' . $this -> getLinterName(). ' ]' ;
88
- }
67
+ abstract protected function isSuppressedForFile (File $file ): bool ;
89
68
90
- /**
91
- * Is this linter error disabled for the entire file?
92
- * Memoized since this should not change per run.
93
- */
94
69
public function isLinterSuppressedForFile (): bool {
95
- return C \contains_key (
96
- $this -> getFile()-> lintMarkersForLineBasedSuppression(),
97
- $this -> getIgnoreAllMarker(),
98
- );
70
+ return $this -> isSuppressedForFile($this -> getFile());
99
71
}
72
+
100
73
}
0 commit comments