-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #136 from streakphp/php80
upgrade to PHP 8.0
- Loading branch information
Showing
105 changed files
with
377 additions
and
563 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,8 @@ | |
|
||
/** | ||
* @author Alan Gabriel Bem <[email protected]> | ||
* | ||
* @see \Streak\Application\Sensor\ProcessingTest | ||
*/ | ||
trait Processing | ||
{ | ||
|
@@ -85,17 +87,22 @@ final public function process(...$messages): void | |
} | ||
|
||
$parameterType = $parameter->getType(); | ||
|
||
// ...is not an union... | ||
if (!$parameterType instanceof \ReflectionNamedType) { | ||
continue; | ||
} | ||
|
||
$parameterType = $parameterType->getName(); | ||
|
||
$messageIsClass = class_exists($parameterType); | ||
$parameterIsClass = \is_object($message); | ||
|
||
if (true === $messageIsClass && true === $parameterIsClass) { | ||
$parameter = $parameter->getClass(); | ||
$target = new \ReflectionClass($message); | ||
|
||
// .. and $message is type or subtype of defined $parameter | ||
while ($parameter->getName() !== $target->getName()) { | ||
while ($parameterType !== $target->getName()) { | ||
$target = $target->getParentClass(); | ||
|
||
if (false === $target) { | ||
|
@@ -147,7 +154,7 @@ final public function process(...$messages): void | |
$this->pending = []; | ||
} | ||
|
||
final private function addEvent(Event $event): void | ||
private function addEvent(Event $event): void | ||
{ | ||
$this->pending[] = Event\Envelope::new($event, $this->producerId()); | ||
} | ||
|
Oops, something went wrong.