Classes/Console/Install/FolderStructure/ExtensionFactory.php
private function appendStructureDefinition(array $original, array $additional)
    {
        foreach ($additional as $additionalStructure) {
            $structureKey = false;
            foreach ($original as $key => $originalStructure) {
                if ($originalStructure['name'] === $additionalStructure['name']) {
                    $structureKey = $key;
                }
            }

            if ($structureKey === false) {
                // Append key to original
                $original[] = $additionalStructure;
            } else {
                // Append children, if necessary
                if (isset($additionalStructure['children'])) {
                    if (isset($original[$structureKey]['children'])) {
                        $original[$structureKey]['children'] = $this->appendStructureDefinition(
                            $original[$structureKey]['children'],
                            $additionalStructure['children']
                        );
                    } else {
                        $original[$structureKey]['children'] = $additionalStructure['children'];
                    }
                }
            }
        }

        return $original;
    }
private function appendStructureDefinition(array $original, array $additional)
    {
        foreach ($additional as $additionalStructure) {
            $structureKey = false;
            foreach ($original as $key => $originalStructure) {
                if ($originalStructure['name'] === $additionalStructure['name']) {
                    $structureKey = $key;
                }
            }

            if ($structureKey === false) {
                // Append key to original
                $original[] = $additionalStructure;
            } else {
                // Append children, if necessary
                if (isset($additionalStructure['children'])) {
                    if (isset($original[$structureKey]['children'])) {
                        $original[$structureKey]['children'] = $this->appendStructureDefinition(
                            $original[$structureKey]['children'],
                            $additionalStructure['children']
                        );
                    } else {
                        $original[$structureKey]['children'] = $additionalStructure['children'];
                    }
                }
            }
        }

        return $original;
    }
Append $original structure definition with $additional structure definition.
Only add missing nodes.

@param array $original
@param array $additional
@return array