Files
WP-LIT-MCP/src/Integrations/Pods/PodsCompatibility.php
T
Jan-Niclas LoosenandClaude Opus 5.5 1a294b7881 feat(pods): Verhaltensprobe als Prüfschritt
Beim Prüfen schreibt und liest PodsProbe auf einem Wegwerf-Entwurf ein Textfeld genau so, wie LIT MCP es tut, vergleicht die Werte und löscht den Entwurf wieder. Bevorzugt von Pods angelegte Typen; ohne Pod mit Textfeld gilt der Schritt als grün mit Hinweis „nicht geprüft“. Ein roter Schritt sperrt Pods über die Berichtssperre. Liegengebliebene Probe-Einträge räumt der Load-Hook des Reiters auf. Pods-Smoke um Probe und Bereinigung erweitert.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 14:33:26 +01:00

57 lines
2.1 KiB
PHP

<?php
declare(strict_types=1);
namespace LIT\MCP\Integrations\Pods;
use LIT\MCP\Compatibility\Call;
use LIT\MCP\Compatibility\ConstantRequirement;
use LIT\MCP\Compatibility\Manifest;
use LIT\MCP\Compatibility\Profile;
use LIT\MCP\Compatibility\Tier;
defined('ABSPATH') || exit;
/**
* Pods as a compatibility profile: the calls PodsFieldSource makes, checked against Pods 3.3.9.2. Argument counts
* are those PodsFieldSource passes; the check adds a behaviour probe (PodsProbe). A hard problem (missing function
* or constant, Pods below 2.8) locks the affected capabilities; Pods has no per-version release.
*/
final class PodsCompatibility
{
public const LABEL = 'Pods';
public static function profile(): Profile
{
$all = PodsFeature::cases();
return new Profile(
id: 'pods',
label: self::LABEL,
tier: Tier::LockOnFailure,
capabilities: $all,
manifests: [new Manifest(
'Pods',
[
new Call('pods_api', 0, [PodsFeature::SchemaRead]),
new Call('PodsAPI::load_pod', 1, [PodsFeature::SchemaRead]),
new Call('pods', 2, [PodsFeature::FieldRead, PodsFeature::FieldWrite]),
new Call('Pods::field', 1, [PodsFeature::FieldRead]),
new Call('Pods::save', 4, [PodsFeature::FieldWrite]),
new Call('pods_has_permissions', 1, [PodsFeature::FieldPermissions]),
new Call('pods_permission', 1, [PodsFeature::FieldPermissions]),
],
[new ConstantRequirement('PODS_VERSION', $all)]
)],
active: static fn (): bool => defined('PODS_VERSION'),
version: static fn (): ?string => defined('PODS_VERSION') ? (string) PODS_VERSION : null,
minVersion: '2.8',
testedVersions: ['3.3.9.2'],
extraSteps: PodsCheckSteps::extra(
static fn (): ?array => (new PodsProbe(new PodsFieldSource(static fn (): bool => true)))->run()
),
stepLabel: PodsCheckSteps::label(...)
);
}
}