File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Parable PHP DI
22
3+ ## 0.2.6
4+
5+ _ Changes_
6+ - ` ReflectionParameter::getClass() ` is deprecated in php 8+, so reworked to use ` ReflectionParameter::getType() ` instead.
7+
38## 0.2.5
49
510_ Changes_
Original file line number Diff line number Diff line change @@ -151,10 +151,11 @@ public function getDependenciesFor(
151151
152152 $ parameters = $ constructor ->getParameters ();
153153
154- $ relationships = [];
155154 $ dependencies = [];
156155 foreach ($ parameters as $ parameter ) {
157- $ class = $ parameter ->getClass ();
156+ $ class = $ parameter ->getType () && !$ parameter ->getType ()->isBuiltin ()
157+ ? new ReflectionClass ($ parameter ->getType ()->getName ())
158+ : null ;
158159
159160 if ($ class === null ) {
160161 if (!$ parameter ->isOptional ()) {
@@ -173,8 +174,6 @@ public function getDependenciesFor(
173174
174175 $ this ->storeRelationship ($ name , $ dependencyName );
175176
176- $ relationships [] = $ dependencyName ;
177-
178177 if ($ useStoredDependencies === self ::USE_NEW_DEPENDENCIES ) {
179178 $ dependencies [] = $ this ->build ($ dependencyName );
180179 } elseif ($ useStoredDependencies === self ::USE_STORED_DEPENDENCIES ) {
You can’t perform that action at this time.
0 commit comments