From 7aa28014aa3889b05eb9a1dc9466aa17848d1084 Mon Sep 17 00:00:00 2001 From: Jasper Tey Date: Mon, 14 Oct 2024 18:51:22 -0400 Subject: [PATCH] Fix phpstan issue. --- src/Support/Domain.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Support/Domain.php b/src/Support/Domain.php index f6172fb..fa15066 100644 --- a/src/Support/Domain.php +++ b/src/Support/Domain.php @@ -123,12 +123,11 @@ public function object(string $type, string $name, bool $absolute = false): Doma { $namespaceResolver = app('ddd')->getApplicationLayerNamespaceResolver(); - $namespace = match (true) { - is_callable($namespaceResolver) => $namespaceResolver( - domain: $this->domainWithSubdomain, - type: $type, - object: $name - ), + $resolvedNamespace = is_callable($namespaceResolver) + ? $namespaceResolver($this->domainWithSubdomain, $type, $name) + : null; + + $namespace = $resolvedNamespace ?? match (true) { $absolute => $this->namespace->root, str($name)->startsWith('\\') => $this->guessNamespaceFromName($name), default => $this->namespaceFor($type),