Skip to content

Commit 3c6aac1

Browse files
committed
Cache static analysis in system temp directory by default
1 parent 2593003 commit 3c6aac1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/CodeCoverage.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use function is_array;
2323
use function is_file;
2424
use function sort;
25+
use function sys_get_temp_dir;
2526
use PHPUnit\Framework\TestCase;
2627
use PHPUnit\Runner\PhptTestCase;
2728
use PHPUnit\Util\Test;
@@ -121,6 +122,10 @@ public function __construct(Driver $driver, Filter $filter)
121122
$this->filter = $filter;
122123
$this->data = new ProcessedCodeCoverageData;
123124
$this->wizard = new Wizard;
125+
126+
if (@is_writable(sys_get_temp_dir())) {
127+
$this->cacheDirectory = sys_get_temp_dir() . '/phpunit/coverage-cache';
128+
}
124129
}
125130

126131
/**

0 commit comments

Comments
 (0)