lithium\analysis\Inspector::isCallable()
Determines if a given method can be called on an object/class.
Parameters
-
string|object
$object
Class or instance to inspect.
-
string
$method
Name of the method.
-
boolean
$internal
Should be
true
if you want to check from inside the class/object. Whenfalse
will also check for public visibility, defaults tofalse
.
Returns
booleanReturns true
if the method can be called, false
otherwise.
Source
public static function isCallable($object, $method, $internal = false) {
$methodExists = method_exists($object, $method);
return $internal ? $methodExists : $methodExists && is_callable([$object, $method]);
}