Skip to content

Commit d36a97f

Browse files
committed
Fix PHP 8.5 deprecation
1 parent a3a23b8 commit d36a97f

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@
125125
"patches/dom_c.patch"
126126
],
127127
"nette/di": [
128-
"patches/DependencyChecker.patch"
128+
"patches/DependencyChecker.patch",
129+
"patches/Resolver.patch"
129130
],
130131
"react/http": [
131132
"patches/Sender.patch"

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

patches/Resolver.patch

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
--- src/DI/Resolver.php 2023-10-02 21:58:38
2+
+++ src/DI/Resolver.php 2025-08-26 09:38:08
3+
@@ -61,13 +61,13 @@
4+
5+
public function resolveDefinition(Definition $def): void
6+
{
7+
- if ($this->recursive->contains($def)) {
8+
+ if (isset($this->recursive[$def])) {
9+
$names = array_map(function ($item) { return $item->getName(); }, iterator_to_array($this->recursive));
10+
throw new ServiceCreationException(sprintf('Circular reference detected for services: %s.', implode(', ', $names)));
11+
}
12+
13+
try {
14+
- $this->recursive->attach($def);
15+
+ $this->recursive[$def] = true;
16+
17+
$def->resolveType($this);
18+
19+
@@ -78,7 +78,7 @@
20+
throw $this->completeException($e, $def);
21+
22+
} finally {
23+
- $this->recursive->detach($def);
24+
+ unset($this->recursive[$def]);
25+
}
26+
}
27+

0 commit comments

Comments
 (0)