Skip to content

Commit 5c85a2c

Browse files
Merge branch '9.2'
2 parents 6f8d062 + 72841b2 commit 5c85a2c

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

src/StaticAnalysis/CachingUncoveredFileAnalyser.php

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ final class CachingUncoveredFileAnalyser extends Cache implements UncoveredFileA
1616
{
1717
private UncoveredFileAnalyser $uncoveredFileAnalyser;
1818

19-
/**
20-
* @var array
21-
*/
22-
private $cache = [];
23-
2419
public function __construct(string $directory, UncoveredFileAnalyser $uncoveredFileAnalyser)
2520
{
2621
parent::__construct($directory);
@@ -30,20 +25,14 @@ public function __construct(string $directory, UncoveredFileAnalyser $uncoveredF
3025

3126
public function executableLinesIn(string $filename): array
3227
{
33-
if (isset($this->cache[$filename])) {
34-
return $this->cache[$filename];
35-
}
36-
3728
if ($this->has($filename, __METHOD__)) {
38-
$this->cache[$filename] = $this->read($filename, __METHOD__);
39-
40-
return $this->cache[$filename];
29+
return $this->read($filename, __METHOD__);
4130
}
4231

43-
$this->cache[$filename] = $this->uncoveredFileAnalyser->executableLinesIn($filename);
32+
$data = $this->uncoveredFileAnalyser->executableLinesIn($filename);
4433

45-
$this->write($filename, __METHOD__, $this->cache[$filename]);
34+
$this->write($filename, __METHOD__, $data);
4635

47-
return $this->cache[$filename];
36+
return $data;
4837
}
4938
}

0 commit comments

Comments
 (0)