Closed glauca closed 1 year ago
Thank you, fixed
before format
<?php
use RuntimeException;
class Message extends App\Services\Kernel\Message
{
public function getOriginalAttributes(): array
{
$attributes = json_decode($this->getOriginalContents(), true);
return is_array($attributes) ? $attributes : [];
}
public function getEventType(): ?string
{
$eventType = $this->getOriginalAttributes()['event_type'];
if (!is_string($eventType)) {
throw new RuntimeException('Invalid event type.');
}
return $eventType;
}
}
after format
<?php
use RuntimeException;
class Message extends App\Services\Kernel\Message
{
public function getOriginalAttributes(): array
{
$attributes = json_decode($this->getOriginalContents(), true);
return is_array($attributes) ? $attributes : [];
}
public function getEventType(): ?string
{
$eventType = $this->getOriginalAttributes()['event_type'];
if (!is_string($eventType)) {
throw new RuntimeException('Invalid event type.');
}
return $eventType;
}
}
Thank you very much @glauca . I've reverted this commit until this is correctly fixed, and published it to Sublime.
Here we go @glauca :)
before format
after format