Symfony\Component\PropertyAccess\PropertyAccessor::isMethodAccessible PHP Method

isMethodAccessible() private method

Returns whether a method is public and has the number of required parameters.
private isMethodAccessible ( ReflectionClass $class, string $methodName, integer $parameters ) : boolean
$class ReflectionClass The class of the method
$methodName string The method name
$parameters integer The number of parameters
return boolean Whether the method is public and has $parameters required parameters
    private function isMethodAccessible(\ReflectionClass $class, $methodName, $parameters)
    {
        if ($class->hasMethod($methodName)) {
            $method = $class->getMethod($methodName);

            if ($method->isPublic()
                && $method->getNumberOfRequiredParameters() <= $parameters
                && $method->getNumberOfParameters() >= $parameters) {
                return true;
            }
        }

        return false;
    }