From f3d72c88c97f1dbee2cff21e0584665cb6196e8c Mon Sep 17 00:00:00 2001 From: Younes ENNAJI Date: Mon, 2 Mar 2026 02:35:27 +0000 Subject: [PATCH] Fix array_merge error and update exception handling --- src/Prime/Notification/Envelope.php | 2 +- src/Prime/Stamp/IdStamp.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Prime/Notification/Envelope.php b/src/Prime/Notification/Envelope.php index 3669c6dc..4ef1dd9c 100644 --- a/src/Prime/Notification/Envelope.php +++ b/src/Prime/Notification/Envelope.php @@ -175,7 +175,7 @@ final class Envelope implements NotificationInterface return [ ...$this->notification->toArray(), - 'metadata' => array_merge(...$stamps), + 'metadata' => $stamps ? array_merge(...$stamps) : [], ]; } diff --git a/src/Prime/Stamp/IdStamp.php b/src/Prime/Stamp/IdStamp.php index 9d57a112..f81c2b05 100644 --- a/src/Prime/Stamp/IdStamp.php +++ b/src/Prime/Stamp/IdStamp.php @@ -19,7 +19,7 @@ final readonly class IdStamp implements PresentableStampInterface, StampInterfac { try { return bin2hex(random_bytes(16)); - } catch (\Exception) { + } catch (\Random\RandomException) { return uniqid('', true); } }