@@ -92,21 +92,21 @@ public function restore(array $allAnalysedFiles, bool $debug, bool $onlyFiles, ?
92
92
{
93
93
$ startTime = microtime (true );
94
94
if ($ debug ) {
95
- if ($ output ->isDebug ()) {
95
+ if ($ output ->isVerbose ()) {
96
96
$ output ->writeLineFormatted ('Result cache not used because of debug mode. ' );
97
97
}
98
98
return new ResultCache ($ allAnalysedFiles , true , time (), $ this ->getMeta ($ allAnalysedFiles , $ projectConfigArray ), [], [], [], [], [], [], [], []);
99
99
}
100
100
if ($ onlyFiles ) {
101
- if ($ output ->isDebug ()) {
101
+ if ($ output ->isVerbose ()) {
102
102
$ output ->writeLineFormatted ('Result cache not used because only files were passed as analysed paths. ' );
103
103
}
104
104
return new ResultCache ($ allAnalysedFiles , true , time (), $ this ->getMeta ($ allAnalysedFiles , $ projectConfigArray ), [], [], [], [], [], [], [], []);
105
105
}
106
106
107
107
$ cacheFilePath = $ this ->cacheFilePath ;
108
108
if (!is_file ($ cacheFilePath )) {
109
- if ($ output ->isDebug ()) {
109
+ if ($ output ->isVerbose ()) {
110
110
$ output ->writeLineFormatted ('Result cache not used because the cache file does not exist. ' );
111
111
}
112
112
return new ResultCache ($ allAnalysedFiles , true , time (), $ this ->getMeta ($ allAnalysedFiles , $ projectConfigArray ), [], [], [], [], [], [], [], []);
@@ -115,7 +115,7 @@ public function restore(array $allAnalysedFiles, bool $debug, bool $onlyFiles, ?
115
115
try {
116
116
$ data = require $ cacheFilePath ;
117
117
} catch (Throwable $ e ) {
118
- if ($ output ->isDebug ()) {
118
+ if ($ output ->isVerbose ()) {
119
119
$ output ->writeLineFormatted (sprintf ('Result cache not used because an error occurred while loading the cache file: %s ' , $ e ->getMessage ()));
120
120
}
121
121
@@ -126,7 +126,7 @@ public function restore(array $allAnalysedFiles, bool $debug, bool $onlyFiles, ?
126
126
127
127
if (!is_array ($ data )) {
128
128
@unlink ($ cacheFilePath );
129
- if ($ output ->isDebug ()) {
129
+ if ($ output ->isVerbose ()) {
130
130
$ output ->writeLineFormatted ('Result cache not used because the cache file is corrupted. ' );
131
131
}
132
132
@@ -135,15 +135,15 @@ public function restore(array $allAnalysedFiles, bool $debug, bool $onlyFiles, ?
135
135
136
136
$ meta = $ this ->getMeta ($ allAnalysedFiles , $ projectConfigArray );
137
137
if ($ this ->isMetaDifferent ($ data ['meta ' ], $ meta )) {
138
- if ($ output ->isDebug ()) {
138
+ if ($ output ->isVerbose ()) {
139
139
$ diffs = $ this ->getMetaKeyDifferences ($ data ['meta ' ], $ meta );
140
140
$ output ->writeLineFormatted ('Result cache not used because the metadata do not match: ' . implode (', ' , $ diffs ));
141
141
}
142
142
return new ResultCache ($ allAnalysedFiles , true , time (), $ meta , [], [], [], [], [], [], [], []);
143
143
}
144
144
145
145
if (time () - $ data ['lastFullAnalysisTime ' ] >= 60 * 60 * 24 * 7 ) {
146
- if ($ output ->isDebug ()) {
146
+ if ($ output ->isVerbose ()) {
147
147
$ output ->writeLineFormatted ('Result cache not used because it \'s more than 7 days since last full analysis. ' );
148
148
}
149
149
// run full analysis if the result cache is older than 7 days
@@ -159,7 +159,7 @@ public function restore(array $allAnalysedFiles, bool $debug, bool $onlyFiles, ?
159
159
continue ;
160
160
}
161
161
if (!is_file ($ extensionFile )) {
162
- if ($ output ->isDebug ()) {
162
+ if ($ output ->isVerbose ()) {
163
163
$ output ->writeLineFormatted (sprintf ('Result cache not used because extension file %s was not found. ' , $ extensionFile ));
164
164
}
165
165
return new ResultCache ($ allAnalysedFiles , true , time (), $ meta , [], [], [], [], [], [], [], []);
@@ -169,7 +169,7 @@ public function restore(array $allAnalysedFiles, bool $debug, bool $onlyFiles, ?
169
169
continue ;
170
170
}
171
171
172
- if ($ output ->isDebug ()) {
172
+ if ($ output ->isVerbose ()) {
173
173
$ output ->writeLineFormatted (sprintf ('Result cache not used because extension file %s hash does not match. ' , $ extensionFile ));
174
174
}
175
175
@@ -287,7 +287,7 @@ public function restore(array $allAnalysedFiles, bool $debug, bool $onlyFiles, ?
287
287
$ filesToAnalyse = array_unique ($ filesToAnalyse );
288
288
$ filesToAnalyseCount = count ($ filesToAnalyse );
289
289
290
- if ($ output ->isDebug ()) {
290
+ if ($ output ->isVerbose ()) {
291
291
$ elapsed = microtime (true ) - $ startTime ;
292
292
$ elapsedString = $ elapsed > 5
293
293
? sprintf (' in %f seconds ' , round ($ elapsed , 1 ))
0 commit comments