refactor(compat): Capability-Interface, DiviFeature implementiert es
Grundlage der generischen Kompatibilitätsschicht für Fremd-Plugins mit inoffiziellen Schnittstellen (Plan docs/superpowers/plans/2026-11-06-kompatibilitaetsschicht.md). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
691231f776
commit
9beb55e228
@@ -4,6 +4,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace LIT\MCP\Integrations\Divi\Release;
|
||||
|
||||
use LIT\MCP\Compatibility\Capability;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
// The installed PHPCompatibility sniffs predate enums (PHP 8.1) and read their methods as plain functions.
|
||||
@@ -13,7 +15,7 @@ defined('ABSPATH') || exit;
|
||||
* 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
|
||||
enum DiviFeature: string implements Capability
|
||||
{
|
||||
case PageRead = 'page-read';
|
||||
case PageWrite = 'page-write';
|
||||
@@ -32,6 +34,11 @@ enum DiviFeature: string
|
||||
case ThemeBuilderRead = 'tb-read';
|
||||
case ThemeBuilderWrite = 'tb-write';
|
||||
|
||||
public function id(): string
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
/** Whether the feature changes data (the seven *Write cases and FontUpload). */
|
||||
public function isWrite(): bool
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user