Skip to content

Commit

Permalink
Only for 5+ secs
Browse files Browse the repository at this point in the history
  • Loading branch information
janedbal committed Jul 11, 2024
1 parent 024c2a4 commit 2d25905
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Analyser/ResultCache/ResultCacheManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,13 @@ public function restore(array $allAnalysedFiles, bool $debug, bool $onlyFiles, ?

if ($output->isDebug()) {
$elapsed = microtime(true) - $startTime;
$elapsedString = $elapsed > 5
? sprintf(' in %f seconds', round($elapsed, 1))
: '';

$output->writeLineFormatted(sprintf(
'Result cache restored in %f seconds. %d %s will be reanalysed.',
round($elapsed, 1),
'Result cache restored%s. %d %s will be reanalysed.',
$elapsedString,
$filesToAnalyseCount,
$filesToAnalyseCount === 1 ? 'file' : 'files',
));
Expand Down

0 comments on commit 2d25905

Please sign in to comment.