Skip to content

Commit 65fce07

Browse files
author
Phil Bennett
committed
Fix an anomoly with PHP stan
1 parent 9fa54d6 commit 65fce07

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
All Notable changes to `League\Container` will be documented in this file
44

5+
### 5.0.1
6+
7+
### Fixed
8+
- Fixed a small unreachable code bug
9+
510
## 5.0.0
611

712
### Added

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
},
5454
"extra": {
5555
"branch-alias": {
56-
"dev-master": "4.x-dev",
56+
"dev-master": "5.x-dev",
5757
"dev-5.x": "5.x-dev",
5858
"dev-4.x": "4.x-dev",
5959
"dev-3.x": "3.x-dev",

src/Container.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,11 @@ protected function resolve(string $id, bool $new = false): mixed
163163
if ($this->providers->provides($id)) {
164164
$this->providers->register($id);
165165

166-
if (false === $this->definitions->has($id)) {
166+
if (false === $this->definitions->has($id) && false === $this->definitions->hasTag($id)) { // @phpstan-ignore-line
167167
throw new ContainerException(sprintf('Service provider lied about providing (%s) service', $id));
168168
}
169169

170-
return $this->resolve($id, $new);
170+
return $this->resolve($id, $new); // @phpstan-ignore-line
171171
}
172172

173173
foreach ($this->delegates as $delegate) {

0 commit comments

Comments
 (0)