Box\Spout\Reader\Common\XMLProcessor::getInvokableCallbackData PHP Method

getInvokableCallbackData() private method

Since some functions can be called a lot, we pre-process the callback to only return the elements that will be needed to invoke the callback later.
private getInvokableCallbackData ( callable $callback ) : array
$callback callable Array reference to a callback: [OBJECT, METHOD_NAME]
return array Associative array containing the elements needed to invoke the callback using Reflection
    private function getInvokableCallbackData($callback)
    {
        $callbackObject = $callback[0];
        $callbackMethodName = $callback[1];
        $reflectionMethod = new \ReflectionMethod(get_class($callbackObject), $callbackMethodName);
        $reflectionMethod->setAccessible(true);
        return [self::CALLBACK_REFLECTION_METHOD => $reflectionMethod, self::CALLBACK_REFLECTION_OBJECT => $callbackObject];
    }