From 7de246d751c86787ed34629ac69b91c2d8c294b0 Mon Sep 17 00:00:00 2001 From: Deeka Wong <8337659+huangdijia@users.noreply.github.com> Date: Tue, 23 Dec 2025 09:22:11 +0800 Subject: [PATCH] fix(sentry): correct singleton key generation logic in SingletonAspect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The condition for appending argument-based suffix to the singleton key was inverted. Changed from `! array_key_exists(0, $arguments)` to `array_key_exists(0, $arguments)` to properly generate unique keys when getInstance is called with an argument. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/sentry/src/Aspect/SingletonAspect.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sentry/src/Aspect/SingletonAspect.php b/src/sentry/src/Aspect/SingletonAspect.php index d64e5c2c8..aa7c6c841 100644 --- a/src/sentry/src/Aspect/SingletonAspect.php +++ b/src/sentry/src/Aspect/SingletonAspect.php @@ -40,7 +40,7 @@ public function process(ProceedingJoinPoint $proceedingJoinPoint) $key = $className = $proceedingJoinPoint->className; $arguments = $proceedingJoinPoint->getArguments(); - if (! array_key_exists(0, $arguments)) { + if (array_key_exists(0, $arguments)) { $key .= '#' . $arguments[0]; }