Skip to content

Commit

Permalink
add support for psr/container >= 2.0 (#354)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lctrs committed Jul 30, 2021
1 parent 70c6357 commit 6298b7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"require": {
"php": "^7.1 || ^8.0",
"psr/container": "^1.0",
"psr/container": "^1.0 || ^2.0",
"symfony/deprecation-contracts": "^2.2"
},
"require-dev": {
Expand Down
6 changes: 5 additions & 1 deletion src/Faker/Extension/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public function __construct(array $definitions)
}

/**
* @param string $id
*
* @throws \InvalidArgumentException
* @throws \RuntimeException
* @throws ContainerException
Expand Down Expand Up @@ -117,9 +119,11 @@ public function get($id)
}

/**
* @param string $id
*
* @throws \InvalidArgumentException
*/
public function has($id)
public function has($id): bool
{
if (!is_string($id)) {
throw new \InvalidArgumentException(sprintf(
Expand Down

0 comments on commit 6298b7f

Please sign in to comment.