From 3a5e3733f70c63294bcf9e2e788db1e33b11992b Mon Sep 17 00:00:00 2001 From: Thomas Portelange Date: Tue, 7 Jan 2025 14:02:14 +0100 Subject: [PATCH] Add enums to cache --- src/Core/Manifest/ClassManifest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Core/Manifest/ClassManifest.php b/src/Core/Manifest/ClassManifest.php index 86fce496433..e3898598c72 100644 --- a/src/Core/Manifest/ClassManifest.php +++ b/src/Core/Manifest/ClassManifest.php @@ -597,7 +597,7 @@ public function handleFile($basename, $pathname, $includeTests) $classes = $data['classes']; $interfaces = $data['interfaces']; $traits = $data['traits']; - $enums = $data['enums'] ?? []; + $enums = $data['enums']; } else { $changed = true; // Build from php file parser @@ -696,6 +696,7 @@ public function handleFile($basename, $pathname, $includeTests) 'classes' => $classes, 'interfaces' => $interfaces, 'traits' => $traits, + 'enums' => $enums, ]; $this->cache->set($key, $cache); } @@ -774,7 +775,7 @@ protected function validateItemCache($data) if (!$data || !is_array($data)) { return false; } - foreach (['classes', 'interfaces', 'traits'] as $key) { + foreach (['classes', 'interfaces', 'traits', 'enums'] as $key) { // Must be set if (!isset($data[$key])) { return false;