@@ -42,6 +42,11 @@ public static function getLinkFormatFromEnv() : string
42
42
#[Override]
43
43
public function formatErrors (AnalysisResult $ analysisResult , Output $ output ) : int
44
44
{
45
+ if ($ this ->editorUrl === null ) {
46
+ $ output ->writeLineFormatted ('<error>Please configure the `editorUrl`.</error> ' );
47
+ $ output ->writeLineFormatted ('' );
48
+ }
49
+
45
50
if (! $ analysisResult ->hasErrors ()) {
46
51
$ output ->writeLineFormatted ('<fg=green;options=bold>No errors</> ' );
47
52
$ output ->writeLineFormatted ('' );
@@ -84,14 +89,14 @@ public function formatErrors(AnalysisResult $analysisResult, Output $output) : i
84
89
(int ) $ error ->getLine (),
85
90
$ error ->getFilePath (),
86
91
$ this ->relativePathHelper ->getRelativePath ($ error ->getFilePath ()),
87
- $ this ->editorUrl ?? '' ,
92
+ $ this ->editorUrl ,
88
93
),
89
94
$ error ->getTraitFilePath () !== null ? $ this ::link (
90
95
$ this ->linkFormat ,
91
96
(int ) $ error ->getLine (),
92
97
$ error ->getTraitFilePath (),
93
98
$ this ->relativePathHelper ->getRelativePath ($ error ->getTraitFilePath ()),
94
- $ this ->editorUrl ?? '' ,
99
+ $ this ->editorUrl ,
95
100
) : '' ,
96
101
]),
97
102
],
@@ -118,8 +123,12 @@ public static function link(
118
123
int $ line ,
119
124
string $ absolutePath ,
120
125
string $ relativePath ,
121
- string $ editorUrl ) : string
122
- {
126
+ ?string $ editorUrl
127
+ ) : string {
128
+ if ($ editorUrl === null ) {
129
+ return sprintf ('%s:%d ' , $ relativePath , $ line );
130
+ }
131
+
123
132
return strtr (
124
133
$ format ,
125
134
[
0 commit comments