Skip to content

Commit

Permalink
Merge pull request #80 from thePanz/patch-1
Browse files Browse the repository at this point in the history
Improve cache error message
  • Loading branch information
goetas authored May 31, 2020
2 parents e5854ab + 82c97c8 commit b7d58bc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Metadata/MetadataFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,12 @@ public function getMetadataForClass($className)
}

if (null !== $classMetadata) {
if ( ! $classMetadata instanceof ClassMetadata) {
throw new \LogicException(sprintf('The cache must return instances of ClassMetadata, but got %s.', var_export($classMetadata, true)));
if (!$classMetadata instanceof ClassMetadata) {
throw new \LogicException(sprintf(
'The cache must return instances of ClassMetadata for class %s, but got %s.',
$className,
var_export($classMetadata, true)
));
}

if ($this->debug && !$classMetadata->isFresh()) {
Expand Down

0 comments on commit b7d58bc

Please sign in to comment.