Skip to content

Commit 6188af0

Browse files
committed
support for PHP 8.5
1 parent 5672c78 commit 6188af0

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
php: ['8.1', '8.2', '8.3', '8.4']
10+
php: ['8.1', '8.2', '8.3', '8.4', '8.5']
1111

1212
fail-fast: false
1313

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
}
1616
],
1717
"require": {
18-
"php": "8.1 - 8.4",
18+
"php": "8.1 - 8.5",
1919
"ext-tokenizer": "*",
2020
"ext-ctype": "*",
2121
"nette/neon": "^3.3",

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The recommended way to install is via Composer:
3939
composer require nette/di
4040
```
4141

42-
It requires PHP version 8.1 and supports PHP up to 8.4.
42+
It requires PHP version 8.1 and supports PHP up to 8.5.
4343

4444
 <!---->
4545

src/DI/Resolver.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ public function getContainerBuilder(): ContainerBuilder
5151

5252
public function resolveDefinition(Definition $def): void
5353
{
54-
if ($this->recursive->contains($def)) {
54+
if (isset($this->recursive[$def])) {
5555
$names = array_map(fn($item) => $item->getName(), iterator_to_array($this->recursive));
5656
throw new ServiceCreationException(sprintf('Circular reference detected for services: %s.', implode(', ', $names)));
5757
}
5858

5959
try {
60-
$this->recursive->attach($def);
60+
$this->recursive[$def] = true;
6161

6262
$def->resolveType($this);
6363

@@ -68,7 +68,7 @@ public function resolveDefinition(Definition $def): void
6868
throw $this->completeException($e, $def);
6969

7070
} finally {
71-
$this->recursive->detach($def);
71+
unset($this->recursive[$def]);
7272
}
7373
}
7474

tests/DI/ContainerBuilder.metadata.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ require __DIR__ . '/../bootstrap.php';
1616
function getPropertyValue($obj, string $name)
1717
{
1818
$prop = (new ReflectionObject($obj))->getProperty($name);
19-
$prop->setAccessible(true);
2019
return $prop->getValue($obj);
2120
}
2221

0 commit comments

Comments
 (0)