lithium\analysis\Inspector::isCallable()
Determines if a given method can be called on an object/class.
Parameters
-
string|object
$objectClass or instance to inspect.
-
string
$methodName of the method.
-
boolean
$internalShould be
trueif you want to check from inside the class/object. Whenfalsewill 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]);
}