adrema/app/Lib/Editor/ConditionResolver.php

22 lines
455 B
PHP
Raw Normal View History

<?php
namespace App\Lib\Editor;
abstract class ConditionResolver
{
/**
* @param array<string, mixed> $block
*/
abstract public function filterBlock(array $block): bool;
/**
* @param array<string, mixed> $content
* @return array<string, mixed>
*/
public function make(array $content): array
{
2024-04-20 00:29:32 +02:00
return array_filter(data_get($content, 'blocks', []), fn ($block) => $this->filterBlock($block));
}
}