asdasd
This commit is contained in:
@@ -240,24 +240,20 @@ class ApiKernel
|
||||
}
|
||||
|
||||
// 💡 Bereinigungsmethode
|
||||
private function cleanReferenceComponents(array $components): array {
|
||||
foreach ($components as &$component) {
|
||||
if (is_array($component) && isset($component['type'])) {
|
||||
private function cleanReferenceComponents(array $node): array
|
||||
{
|
||||
if (isset($node['type']) && $node['type'] === 'library-reference') {
|
||||
$node['content'] = '';
|
||||
$node['components'] = [];
|
||||
}
|
||||
|
||||
if ($component['type'] === 'library-reference') {
|
||||
if (isset($component['content'])) {
|
||||
$component['content'] = '';
|
||||
}
|
||||
if (isset($component['components'])) {
|
||||
$component['components'] = [];
|
||||
}
|
||||
}
|
||||
if (isset($component['components']) && is_array($component['components'])) {
|
||||
$component['components'] = $this->cleanReferenceComponents($component['components']);
|
||||
}
|
||||
foreach ($node as $key => $value) {
|
||||
if (is_array($value)) {
|
||||
$node[$key] = $this->cleanReferenceComponents($value);
|
||||
}
|
||||
}
|
||||
return $components;
|
||||
|
||||
return $node;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user