Skip to content

Commit

Permalink
Some services may not be mapped by MVC, like Mezzio ones (Slamdunk#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
Slamdunk authored May 18, 2021
1 parent 6d815cb commit 6903299
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
],
"require": {
"php": "^7.4 || ^8.0",
"phpstan/phpstan": "^0.12.86"
"phpstan/phpstan": "^0.12.88"
},
"conflict": {
"laminas/laminas-cache": "<2.11",
Expand Down
7 changes: 6 additions & 1 deletion src/UnmappedAliasServiceLocatorProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,17 @@ public function __construct(ServiceLocatorInterface $serviceLocator)

public function get($id)
{
if ($this->serviceLocator->has($id)) {
return $this->serviceLocator->get($id);
}

return $this->serviceLocator->get($this->knownUnmappedAliasToClassServices[$id] ?? $id);
}

public function has($id)
{
return $this->serviceLocator->has($this->knownUnmappedAliasToClassServices[$id] ?? $id);
return $this->serviceLocator->has($id)
|| $this->serviceLocator->has($this->knownUnmappedAliasToClassServices[$id] ?? $id);
}

/**
Expand Down

0 comments on commit 6903299

Please sign in to comment.