Skip to content

Commit

Permalink
nette/di - patch for PHP 8.4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Jul 7, 2024
1 parent 30a51ac commit 1245ea7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@
"patches/SessionHandler.patch",
"patches/xmlreader.patch",
"patches/dom_c.patch"
],
"nette/di": [
"patches/DependencyChecker.patch"
]
}
},
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions patches/DependencyChecker.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- src/DI/DependencyChecker.php 2023-10-02 21:58:38
+++ src/DI/DependencyChecker.php 2024-07-07 09:24:35
@@ -147,7 +147,9 @@
$flip = array_flip($classes);
foreach ($functions as $name) {
if (strpos($name, '::')) {
- $method = new ReflectionMethod($name);
+ $method = PHP_VERSION_ID < 80300
+ ? new ReflectionMethod($name)
+ : ReflectionMethod::createFromMethodName($name);
$class = $method->getDeclaringClass();
if (isset($flip[$class->name])) {
continue;

0 comments on commit 1245ea7

Please sign in to comment.