Skip to content

Commit

Permalink
Fix phpstan issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspertey committed Oct 14, 2024
1 parent e621734 commit 7aa2801
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/Support/Domain.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 7aa2801

Please sign in to comment.