Skip to content

Commit

Permalink
ServiceManager::get returns mixed
Browse files Browse the repository at this point in the history
Signed-off-by: Jens Hatlak <[email protected]>
  • Loading branch information
jhatlak committed Mar 13, 2024
1 parent a901b67 commit 85416ee
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ServiceManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ public function get(string $id): mixed
// We start by checking if we have cached the requested service;
// this is the fastest method.
if (isset($this->services[$id])) {
/** @psalm-suppress MixedReturnStatement Yes indeed, service managers can return mixed. */
return $this->services[$id];
}

Expand All @@ -217,6 +218,8 @@ public function get(string $id): mixed
if ($sharedService) {
$this->services[$id] = $service;
}

/** @psalm-suppress MixedReturnStatement Yes indeed, service managers can return mixed. */
return $service;
}

Expand All @@ -234,6 +237,8 @@ public function get(string $id): mixed
// If the alias is configured as a shared service, we are done.
if ($sharedAlias) {
$this->services[$id] = $this->services[$resolvedName];

/** @psalm-suppress MixedReturnStatement Yes indeed, service managers can return mixed. */
return $this->services[$resolvedName];
}

Expand All @@ -247,6 +252,7 @@ public function get(string $id): mixed
$this->services[$id] = $service;
}

/** @psalm-suppress MixedReturnStatement Yes indeed, service managers can return mixed. */
return $service;
}

Expand Down

0 comments on commit 85416ee

Please sign in to comment.