From 75853e1623efa5aa5e65e986ec9a97db573a5267 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Fri, 30 Dec 2022 01:21:42 +0100 Subject: [PATCH] Do not re-alias SerializationException (#154) --- lib/Sync/functions.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Sync/functions.php b/lib/Sync/functions.php index 850c0c17..d5ba431b 100644 --- a/lib/Sync/functions.php +++ b/lib/Sync/functions.php @@ -4,8 +4,10 @@ use Amp\Serialization\SerializationException as SerializerException; -// Alias must be defined in an always-loaded file as catch blocks do not trigger the autoloader. -\class_alias(SerializerException::class, SerializationException::class); +if (!\class_exists(SerializationException::class)) { + // Alias must be defined in an always-loaded file as catch blocks do not trigger the autoloader. + \class_alias(SerializerException::class, SerializationException::class); +} /** * @param \Throwable $exception