refactor(compat): Prüfbausteine nach src/Compatibility, Matrix und ManifestCheck generisch
Requirement, Call, ConstantRequirement, Mirror, Problem, FeatureStatus, CompatibilityMatrix, Manifest, ManifestCheck sowie Fingerprints und LineDiff liegen jetzt im divi-freien Kern. Neu: GlobalRequirement, CompatibilityMatrix::fromProblems(), ManifestCheck-Option signatures, DiviManifestCheck::create() und DiviAreas. Divi-Verhalten unverändert. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
9beb55e228
commit
b511ef6348
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace LIT\MCP\Integrations\Divi\Release;
|
||||
|
||||
use LIT\MCP\Compatibility\ManifestCheck;
|
||||
use LIT\MCP\Compatibility\Mirror;
|
||||
use LIT\MCP\Compatibility\SourceFingerprint;
|
||||
use LIT\MCP\Integrations\Divi\Schema\DiviModules;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
/** The ManifestCheck of Divi: its adapter manifests, signature references, theme sources and block registry. */
|
||||
final class DiviManifestCheck
|
||||
{
|
||||
public static function create(): ManifestCheck
|
||||
{
|
||||
return new ManifestCheck(
|
||||
DiviAdapters::manifests(),
|
||||
DiviReference::expected(),
|
||||
self::installed(...),
|
||||
DiviModules::knowsBlock(...)
|
||||
);
|
||||
}
|
||||
|
||||
private static function installed(Mirror $mirror): ?string
|
||||
{
|
||||
$dir = DiviEnvironment::themeDir();
|
||||
|
||||
return $dir === null
|
||||
? null
|
||||
: SourceFingerprint::of($dir . '/' . $mirror->file, $mirror->function, $mirror->class)->hash;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user