feat: Divi-Fähigkeiten (DiviFeature, Requirement, ConstantRequirement) an Call, Mirror und Manifest; alle acht Adapter getaggt; Tests für Vollständigkeit und die gepinnte Zuordnung
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
e6e0f914ba
commit
392fe7c569
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace LIT\MCP\Integrations\Divi\Release;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
// The installed PHPCompatibility sniffs predate enums (PHP 8.1) and read their methods as plain functions.
|
||||
// phpcs:disable PHPCompatibility.Variables.ForbiddenThisUseContexts.OutsideObjectContext
|
||||
|
||||
/**
|
||||
* What the plugin can do with Divi, as far as a Divi update may break it separately: every manifest entry (call,
|
||||
* mirror, constant) belongs to one or more features, and the release gate decides per feature.
|
||||
*/
|
||||
enum DiviFeature: string
|
||||
{
|
||||
case PageRead = 'page-read';
|
||||
case PageWrite = 'page-write';
|
||||
case Catalog = 'catalog';
|
||||
case DynamicSources = 'dynamic-sources';
|
||||
case DesignRead = 'design-read';
|
||||
case PresetWrite = 'preset-write';
|
||||
case LibraryRead = 'library-read';
|
||||
case LibraryWrite = 'library-write';
|
||||
case Roles = 'roles';
|
||||
case ThemeBuilderRead = 'tb-read';
|
||||
case ThemeBuilderWrite = 'tb-write';
|
||||
|
||||
/** Whether the feature changes data (the four *Write cases). */
|
||||
public function isWrite(): bool
|
||||
{
|
||||
return match ($this) {
|
||||
self::PageWrite, self::PresetWrite, self::LibraryWrite, self::ThemeBuilderWrite => true,
|
||||
default => false,
|
||||
};
|
||||
}
|
||||
|
||||
/** Name for messages, the status tool and the admin tab (German). */
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::PageRead => 'Seiten lesen',
|
||||
self::PageWrite => 'Seiten schreiben',
|
||||
self::Catalog => 'Modulkatalog',
|
||||
self::DynamicSources => 'Dynamische Inhalte',
|
||||
self::DesignRead => 'Designsystem lesen',
|
||||
self::PresetWrite => 'Presets schreiben',
|
||||
self::LibraryRead => 'Bibliothek lesen',
|
||||
self::LibraryWrite => 'Bibliothek schreiben',
|
||||
self::Roles => 'Divi-Rollen',
|
||||
self::ThemeBuilderRead => 'Theme Builder lesen',
|
||||
self::ThemeBuilderWrite => 'Theme Builder schreiben',
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user