Box\Spout\Reader\Common\XMLProcessor::getRegisteredCallbackData PHP Метод

getRegisteredCallbackData() приватный Метод

private getRegisteredCallbackData ( string $nodeNamePossiblyWithPrefix, string $nodeNameWithoutPrefix, integer $nodeType ) : array | null
$nodeNamePossiblyWithPrefix string Name of the node, possibly prefixed
$nodeNameWithoutPrefix string Name of the same node, un-prefixed
$nodeType integer Type of the node [NODE_TYPE_START || NODE_TYPE_END]
Результат array | null Callback data to be used for execution when a node of the given name/type is read or NULL if none found
    private function getRegisteredCallbackData($nodeNamePossiblyWithPrefix, $nodeNameWithoutPrefix, $nodeType)
    {
        // With prefixed nodes, we should match if (by order of preference):
        //  1. the callback was registered with the prefixed node name (e.g. "x:worksheet")
        //  2. the callback was registered with the un-prefixed node name (e.g. "worksheet")
        $callbackKeyForPossiblyPrefixedName = $this->getCallbackKey($nodeNamePossiblyWithPrefix, $nodeType);
        $callbackKeyForUnPrefixedName = $this->getCallbackKey($nodeNameWithoutPrefix, $nodeType);
        $hasPrefix = $nodeNamePossiblyWithPrefix !== $nodeNameWithoutPrefix;
        $callbackKeyToUse = $callbackKeyForUnPrefixedName;
        if ($hasPrefix && isset($this->callbacks[$callbackKeyForPossiblyPrefixedName])) {
            $callbackKeyToUse = $callbackKeyForPossiblyPrefixedName;
        }
        // Using isset here because it is way faster than array_key_exists...
        return isset($this->callbacks[$callbackKeyToUse]) ? $this->callbacks[$callbackKeyToUse] : null;
    }