diff --git a/src/Cache/FileCache.php b/src/Cache/FileCache.php index 06e0f92..da7648c 100644 --- a/src/Cache/FileCache.php +++ b/src/Cache/FileCache.php @@ -5,6 +5,7 @@ use Closure; use FastRoute\Cache; +use FastRoute\DataGenerator; use RuntimeException; use function chmod; @@ -22,6 +23,7 @@ use const LOCK_EX; +/** @phpstan-import-type RouteData from DataGenerator */ final class FileCache implements Cache { private const DIRECTORY_PERMISSIONS = 0775; @@ -53,7 +55,7 @@ public function get(string $key, callable $loader): array return $data; } - /** @return array{0: array>, 1: array}>}>>}|null */ + /** @return RouteData|null */ private static function readFileContents(string $path): ?array { // error suppression is faster than calling `file_exists()` + `is_file()` + `is_readable()`, especially because there's no need to error here