@@ -37,9 +37,10 @@ public function __construct($data)
3737 /**
3838 * If the dependency injector tries to read an interface in controller it
3939 * will search for the object in interfaceFactory.
40- * @return controller
40+ * @param callable $call
41+ * @return void
4142 */
42- public static function interfaceFactory ($ call ): void
43+ public static function interfaceFactory (callable $ call ): void
4344 {
4445 self ::$ interfaceFactory [] = function ($ short , $ class , $ reflect ) use ($ call ) {
4546 //self::$interfaceProtocol[$short] = $call($class, $short, $reflect);
@@ -59,9 +60,9 @@ public function allowInterfaces(bool $bool): void
5960
6061 /**
6162 * Call dependency injector
62- * @return controller
63+ * @return object
6364 */
64- public function dependencyInjector ()
65+ public function dependencyInjector (): object
6566 {
6667 $ params = $ this ->reflect ->getConstructor ()->getParameters ();
6768 $ this ->injectRecursion ($ params , $ this ->reflect ->getName ());
@@ -99,13 +100,14 @@ private function initReclusiveReflect(string $className, string $fromClass): Ref
99100
100101 /**
101102 * Recursion inject dependancies
102- * @param array $params
103- * @param array $args
103+ * @param array $params
104+ * @param string $fromClass
105+ * @param array $_args
104106 * @return array
105107 */
106- private function injectRecursion (array $ params , string $ fromClass , array $ args = array ())
108+ private function injectRecursion (array $ params , string $ fromClass , array $ _args = array ()): array
107109 {
108- $ args = array ();
110+ $ _args = array ();
109111 foreach ($ params as $ param ) {
110112 if ($ param ->getType () && !$ param ->getType ()->isBuiltin ()) {
111113 $ classNameA = $ param ->getType ()->getName ();
@@ -118,23 +120,23 @@ private function injectRecursion(array $params, string $fromClass, array $args =
118120 }
119121
120122 if (count ($ reflectParam ) > 0 ) {
121- $ args = $ this ->injectRecursion ($ reflectParam , $ inst ->getName (), $ args );
123+ $ _args = $ this ->injectRecursion ($ reflectParam , $ inst ->getName (), $ _args );
122124
123125 // Will make it posible to set same instance in multiple nested classes
124- $ args = $ this ->insertMultipleNestedClasses ($ inst , $ constructor , $ classNameA , $ reflectParam );
126+ $ _args = $ this ->insertMultipleNestedClasses ($ inst , $ constructor , $ classNameA , $ reflectParam );
125127 } else {
126128 if ($ inst ->isInterface ()) {
127129 $ this ->insertInterfaceClasses ($ inst , $ classNameA );
128130 } else {
129131 if (empty (self ::$ class [$ classNameA ])) {
130- self ::$ class [$ classNameA ] = $ this ->newInstance ($ inst , (bool )$ constructor , $ args );
132+ self ::$ class [$ classNameA ] = $ this ->newInstance ($ inst , (bool )$ constructor , $ _args );
131133 }
132134 }
133- $ args [] = self ::$ class [$ classNameA ];
135+ $ _args [] = self ::$ class [$ classNameA ];
134136 }
135137 }
136138 }
137- return $ args ;
139+ return $ _args ;
138140 }
139141
140142 /**
@@ -252,9 +254,9 @@ public static function getClassList()
252254
253255 /**
254256 * Load dependencyInjector / or just a container
255- * @return instance
257+ * @return object
256258 */
257- private function getClass ()
259+ private function getClass (): object
258260 {
259261 if (!is_null ($ this ->args )) {
260262 $ inst = $ this ->reflect ->newInstanceArgs ($ this ->args );
0 commit comments