@@ -55,10 +55,11 @@ protected static function isItemOrderInvalid($item, $array)
55
55
}
56
56
57
57
/**
58
- * Gets the parameter of a callable thing (from is_callable) and returns it's arguments using reflection
58
+ * Gets the parameter of a callable thing (from is_callable) and returns it's arguments using reflection.
59
59
*
60
- * @param callable $callable
60
+ * @param callable $callable
61
61
* @return \ReflectionParameter[]
62
+ *
62
63
* @throws \ReflectionException
63
64
* @throws \InvalidArgumentException
64
65
*/
@@ -70,14 +71,14 @@ private static function reflectCallableParameters($callable)
70
71
*/
71
72
if ($ callable instanceof Closure) {
72
73
$ reflection = new ReflectionFunction ($ callable );
73
- } else if (is_string ($ callable ) && function_exists ($ callable )) {
74
+ } elseif (is_string ($ callable ) && function_exists ($ callable )) {
74
75
$ reflection = new ReflectionFunction ($ callable );
75
- } else if (is_string ($ callable ) && str_contains ($ callable , ':: ' )) {
76
+ } elseif (is_string ($ callable ) && str_contains ($ callable , ':: ' )) {
76
77
$ reflection = new ReflectionMethod ($ callable );
77
- } else if (is_object ($ callable ) && method_exists ($ callable , '__invoke ' )) {
78
+ } elseif (is_object ($ callable ) && method_exists ($ callable , '__invoke ' )) {
78
79
$ reflection = new ReflectionMethod ($ callable , '__invoke ' );
79
80
} else {
80
- throw new \InvalidArgumentException (" argument is not callable or the code is wrong " );
81
+ throw new \InvalidArgumentException (' argument is not callable or the code is wrong ' );
81
82
}
82
83
83
84
return $ reflection ->getParameters ();
0 commit comments