private function getAccessorMethod(string $class, string $property): ?array
    {
        $ucProperty = ucfirst($property);

        foreach ($this->accessorPrefixes as $prefix) {
            try {
                $reflectionMethod = new \ReflectionMethod($class, $prefix.$ucProperty);
                if ($reflectionMethod->isStatic()) {
                    continue;
                }

                if (0 === $reflectionMethod->getNumberOfRequiredParameters()) {
                    return [$reflectionMethod, $prefix];
                }
            } catch (\ReflectionException $e) {
                // Return null if the property doesn't exist
            }
        }

        return null;
    }
private function getAccessorMethod(string $class, string $property): ?array
    {
        $ucProperty = ucfirst($property);

        foreach ($this->accessorPrefixes as $prefix) {
            try {
                $reflectionMethod = new \ReflectionMethod($class, $prefix.$ucProperty);
                if ($reflectionMethod->isStatic()) {
                    continue;
                }

                if (0 === $reflectionMethod->getNumberOfRequiredParameters()) {
                    return [$reflectionMethod, $prefix];
                }
            } catch (\ReflectionException $e) {
                // Return null if the property doesn't exist
            }
        }

        return null;
    }
private function getAccessorMethod ( string $ class , string $ property ) : ? array { $ ucProperty = ucfirst ( $ property ) ; foreach ( $ this -> accessorPrefixes as $ prefix ) { try { $ reflectionMethod = new \ ReflectionMethod ( $ class , $ prefix . $ ucProperty ) ; if ( $ reflectionMethod -> isStatic ( ) ) { continue ; } if ( 0 === $ reflectionMethod -> getNumberOfRequiredParameters ( ) ) { return [ $ reflectionMethod , $ prefix ] ; } } catch ( \ ReflectionException $ e ) { // Return null if the property doesn't exist } } return null ; }
Gets the accessor method.

Returns an array with a the instance of \ReflectionMethod as first key
and the prefix of the method as second or null if not found.
Gets the accessor method .