|null $checks Label => check; null = defaults(). */ public function __construct(private ?array $checks = null) { } /** @return list Labels of the checks that failed or threw. */ public function problems(): array { $problems = []; foreach ($this->checks ?? self::defaults() as $label => $check) { try { $ok = (bool) $check(); } catch (Throwable) { $ok = false; } if (! $ok) { $problems[] = (string) $label; } } return $problems; } /** @return array */ public static function defaults(): array { return [ 'ModuleRegistration (Modul-Katalog)' => static fn (): bool => DiviModules::isAvailable(), 'DynamicContentOptions (Dynamic Content)' => static fn (): bool => class_exists(DynamicContentMap::REGISTRY), 'et_pb_is_allowed (Divi-Rollen)' => static fn (): bool => function_exists('et_pb_is_allowed'), 'Post-Typ et_pb_layout (Bibliothek)' => static fn (): bool => post_type_exists(DiviLibraryStore::POST_TYPE), 'Taxonomien scope, layout_type, module_width (Bibliothek)' => static fn (): bool => (new DiviLibraryStore())->missingTaxonomies() === [], 'GlobalLayout::is_global_layout_template (globale Module)' => static fn (): bool => method_exists(DiviLibraryStore::GLOBAL_LAYOUT, 'is_global_layout_template'), 'ET_Core_PageResource (CSS-Cache)' => static fn (): bool => class_exists('ET_Core_PageResource'), ]; } }