lithium\analysis\Inspector::isCallable()

public static method

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. When false will also check for public visibility, defaults to false.

Returns

boolean

Returns 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]);
	}