Skip to content

Commit

Permalink
Reflection may reference interfaces and enums
Browse files Browse the repository at this point in the history
  • Loading branch information
weirdan committed Jan 29, 2024
1 parent b12c10c commit cabdf19
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/Internal/Codebase/InternalCallMapHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@
use function array_shift;
use function class_exists;
use function count;
use function enum_exists;
use function explode;
use function function_exists;
use function in_array;
use function interface_exists;
use function is_array;
use function is_int;
use function json_encode;
Expand Down Expand Up @@ -631,6 +633,8 @@ private function assertTypeValidity(ReflectionType $reflected, string $specified
} catch (InvalidArgumentException $e) {
if (preg_match('/^Could not get class storage for (.*)$/', $e->getMessage(), $matches)
&& !class_exists($matches[1])
&& !interface_exists($matches[1])
&& !enum_exists($matches[1])
) {
$this->fail("Class used in CallMap does not exist: {$matches[1]}");
}
Expand Down

0 comments on commit cabdf19

Please sign in to comment.