Skip to content

Commit

Permalink
Fix PossiblyFalseArgument error in MissingBatchItemException
Browse files Browse the repository at this point in the history
  • Loading branch information
jdecool committed Jan 28, 2025
1 parent d927d38 commit b2f1117
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,17 @@ class MissingBatchItemException extends UnexpectedValueException implements Exce
{
public static function fromInvalidReference(ClassMetadata $metadata, object $object): MissingBatchItemException
{
$identifier = json_encode($metadata->getIdentifierValues($object));
if ($identifier === false) {
$identifier = 'unknown';
}

return new self(sprintf(
'Requested batch item %s#%s (of type %s) with identifier "%s" could not be found',
get_class($object),
spl_object_hash($object),
$metadata->getName(),
json_encode($metadata->getIdentifierValues($object)),
$identifier,
));
}
}

0 comments on commit b2f1117

Please sign in to comment.