@@ -52,7 +52,13 @@ public static function basename(Throwable $class): string
52
52
return basename (str_replace ('\\' , '/ ' , $ class ));
53
53
}
54
54
55
- public static function call ($ object , string $ method )
55
+ /**
56
+ * @param Throwable $object
57
+ * @param string $method
58
+ *
59
+ * @return bool
60
+ */
61
+ public static function call (Throwable $ object , string $ method )
56
62
{
57
63
if (method_exists ($ object , $ method )) {
58
64
return call_user_func ([$ object , $ method ]);
@@ -61,7 +67,13 @@ public static function call($object, string $method)
61
67
return null ;
62
68
}
63
69
64
- public static function callsWhenNotEmpty ($ object , $ methods )
70
+ /**
71
+ * @param Throwable $object
72
+ * @param string|array $methods
73
+ *
74
+ * @return mixed|null
75
+ */
76
+ public static function callsWhenNotEmpty (Throwable $ object , $ methods )
65
77
{
66
78
$ methods = Arr::wrap ($ methods );
67
79
@@ -74,34 +86,54 @@ public static function callsWhenNotEmpty($object, $methods)
74
86
return null ;
75
87
}
76
88
89
+ /**
90
+ * @param mixed $value
91
+ *
92
+ * @return bool
93
+ */
77
94
protected static function isExistsObject ($ value ): bool
78
95
{
79
96
return static ::isObject ($ value ) ?: static ::isClassExists ($ value );
80
97
}
81
98
99
+ /**
100
+ * @param mixed $value
101
+ *
102
+ * @return bool
103
+ */
82
104
protected static function isClassExists ($ class ): bool
83
105
{
84
106
return is_string ($ class ) && class_exists ($ class );
85
107
}
86
108
109
+ /**
110
+ * @param mixed $value
111
+ *
112
+ * @return bool
113
+ */
87
114
protected static function isObject ($ value ): bool
88
115
{
89
116
return is_object ($ value );
90
117
}
91
118
92
119
/**
93
- * @param object|string $class
120
+ * @param Throwable $class
94
121
*
95
122
* @throws \ReflectionException
96
123
*
97
124
* @return \ReflectionClass
98
125
*/
99
- protected static function reflection ($ class )
126
+ protected static function reflection (Throwable $ class ): ReflectionClass
100
127
{
101
128
return new ReflectionClass ($ class );
102
129
}
103
130
104
- protected static function make ($ class )
131
+ /**
132
+ * @param Throwable|string $class
133
+ *
134
+ * @return Throwable
135
+ */
136
+ protected static function make ($ class ): Throwable
105
137
{
106
138
$ is_object = static ::isObject ($ class );
107
139
0 commit comments