Skip to content

Commit 71321fe

Browse files
authored
fix phpstan 1.9.3 compat (#486)
1 parent ec05121 commit 71321fe

13 files changed

+5208
-434
lines changed

.phpstan-dba-mysqli.cache

Lines changed: 148 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.phpstan-dba-pdo-mysql.cache

Lines changed: 148 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/QueryReflection/ReflectionCache.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
final class ReflectionCache
1515
{
16-
public const SCHEMA_VERSION = 'v10-rework-replay';
16+
public const SCHEMA_VERSION = 'v11-phpstan1_9_3-update';
1717

1818
/**
1919
* @var string
@@ -136,7 +136,14 @@ private function readCachedRecords(bool $useReadLock): ?array
136136
if ($useReadLock) {
137137
flock(self::$lockHandle, \LOCK_SH);
138138
}
139-
$cache = require $this->cacheFile;
139+
140+
try {
141+
$cache = require $this->cacheFile;
142+
} catch (\Throwable $e) {
143+
// in case of invalid cache,
144+
// or incompatible class definitions between phpstan versions
145+
return null;
146+
}
140147
} finally {
141148
if ($useReadLock) {
142149
flock(self::$lockHandle, \LOCK_UN);

0 commit comments

Comments
 (0)