-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backporting psr/container ^2.0 change from laminas/laminas-serviceman…
- Loading branch information
Showing
5 changed files
with
45 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,7 +143,6 @@ public function setService($name, $service) | |
|
||
/** | ||
* @param class-string<InstanceType>|string $name Service name of plugin to retrieve. | ||
Check failure on line 145 in src/AbstractPluginManager.php GitHub Actions / ci / QA Checks (Psalm [8.1, locked], ubuntu-latest, laminas/laminas-continuous-integration-action@v1, ...UnusedDocblockParam
|
||
* @param null|array<mixed> $options Options to use when creating the instance. | ||
* @return mixed | ||
Check failure on line 146 in src/AbstractPluginManager.php GitHub Actions / ci / QA Checks (PHPCodeSniffer [8.1, locked], ubuntu-latest, laminas/laminas-continuous-integration-ac...
|
||
* @psalm-return ($name is class-string<InstanceType> ? InstanceType : mixed) | ||
* @throws Exception\ServiceNotFoundException If the manager does not have | ||
|
@@ -152,21 +151,21 @@ public function setService($name, $service) | |
* @throws InvalidServiceException If the plugin created is invalid for the | ||
* plugin context. | ||
*/ | ||
public function get($name, ?array $options = null) | ||
public function get(string $id): mixed | ||
Check failure on line 154 in src/AbstractPluginManager.php GitHub Actions / ci / QA Checks (Psalm [8.1, locked], ubuntu-latest, laminas/laminas-continuous-integration-action@v1, ...InvalidDocblock
|
||
{ | ||
if (! $this->has($name)) { | ||
if (! $this->autoAddInvokableClass || ! class_exists($name)) { | ||
if (! $this->has($id)) { | ||
if (! $this->autoAddInvokableClass || ! class_exists($id)) { | ||
throw new Exception\ServiceNotFoundException(sprintf( | ||
'A plugin by the name "%s" was not found in the plugin manager %s', | ||
$name, | ||
$id, | ||
static::class | ||
)); | ||
} | ||
|
||
$this->setFactory($name, Factory\InvokableFactory::class); | ||
$this->setFactory($id, Factory\InvokableFactory::class); | ||
} | ||
|
||
$instance = ! $options ? parent::get($name) : $this->build($name, $options); | ||
$instance = parent::get($id); | ||
$this->validate($instance); | ||
return $instance; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters