| Conditions | 4 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | public function handler(mixed $message, array $context = []): string |
||
| 21 | { |
||
| 22 | if (is_object($message)) { |
||
| 23 | if ($message instanceof JsonSerializable) { |
||
| 24 | return parent::handler($this->encode($message)); |
||
| 25 | } |
||
| 26 | |||
| 27 | if (method_exists($message, '__toString')) { |
||
| 28 | return parent::handler($message); |
||
| 29 | } |
||
| 30 | |||
| 31 | return $this->encode(get_class($message)) . ' {}'; |
||
| 32 | } |
||
| 33 | |||
| 34 | return parent::handler($message, $context); |
||
| 35 | } |
||
| 37 |