The following is my function,
protected function mergeMetadataElement(array $bundleComponents, $name, array $data, $reverseMerge = false)
{
if (isset($bundleComponents[$name])) {
$bundleComponents[$name] = $reverseMerge
? array_replace_recursive($data, $bundleComponents[$name])
: array_replace_recursive($bundleComponents[$name], $data);
return [$bundleComponents, true];
} else {
foreach ($bundleComponents as &$childData) {
if (isset($childData['attributes']['class'])
&& is_a($childData['attributes']['class'], \Magento\Ui\Component\Container::class, true)
&& isset($childData['children']) && is_array($childData['children'])
) {
list($childData['children'], $isMerged) = $this->mergeMetadataElement(
$childData['children'],
$name,
$data,
$reverseMerge
);
if ($isMerged) {
return [$bundleComponents, true];
}
}
}
}
return [$bundleComponents, false];
}
the third argument $data return null, how to debug whether the data is getting or not?