Skip to content

Commit

Permalink
Merge pull request #42 from prooph/prolic-patch-1
Browse files Browse the repository at this point in the history
faster fqcn message factory
  • Loading branch information
prolic committed Sep 15, 2015
2 parents 804ae8f + 5c968da commit f1fcebd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Messaging/FQCNMessageFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ public function createMessageFromArray($messageName, array $messageData)
throw new \UnexpectedValueException('Given message name is not a valid class: ' . (string)$messageName);
}

$ref = new \ReflectionClass($messageName);

if (!$ref->isSubclassOf(DomainMessage::class)) {
if (!is_subclass_of($messageName, DomainMessage::class)) {
throw new \UnexpectedValueException(sprintf(
'Message class %s is not a sub class of %s',
$messageName,
Expand Down

0 comments on commit f1fcebd

Please sign in to comment.