Skip to content
This repository has been archived by the owner on Jun 23, 2021. It is now read-only.

Commit

Permalink
III-1686 Removed getClassName in favor of get_class.
Browse files Browse the repository at this point in the history
  • Loading branch information
Luc Wollants committed Dec 9, 2016
1 parent bc9e9d1 commit f14b913
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/Broadway/Saga/NamespacedEventsMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct($criteria)
*/
public function handles($event)
{
$eventName = $this->getClassName($event);
$eventName = get_class($event);

return isset($this->criteria[$eventName]);
}
Expand All @@ -35,21 +35,12 @@ public function handles($event)
*/
public function criteria($event)
{
$eventName = $this->getClassName($event);
$eventName = get_class($event);

if (! isset($this->criteria[$eventName])) {
throw new \RuntimeException(sprintf("No criteria for event '%s'.", $eventName));
}

return $this->criteria[$eventName]($event);
}

/**
* @param mixed $event
* @return string
*/
private function getClassName($event)
{
return get_class($event);
}
}

0 comments on commit f14b913

Please sign in to comment.