feat: Divi manifests, adapter register and boundary test
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace LIT\MCP\Integrations\Divi\Release;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
/**
|
||||
* A Divi function whose storage logic an adapter repeats instead of calling it (spec §4.1 "mirrors"). Its
|
||||
* fingerprint (SourceFingerprint) must match the one in fingerprints.json, else Divi changed what we copy.
|
||||
*/
|
||||
final class Mirror
|
||||
{
|
||||
/**
|
||||
* @param string $id Key in fingerprints.json and name of tests/Fixtures/divi/reference/<id>.txt.
|
||||
* @param string $file Divi file, relative to the Divi theme directory.
|
||||
* @param string $function Function or method name.
|
||||
* @param string|null $class Class of a method – the short name is enough (the file fixes where it
|
||||
* lives, and a short name is no Divi name for DiviBoundaryTest); null for a function.
|
||||
* @param string $what What the plugin repeats (German, for reports).
|
||||
*/
|
||||
public function __construct(
|
||||
public readonly string $id,
|
||||
public readonly string $file,
|
||||
public readonly string $function,
|
||||
public readonly ?string $class,
|
||||
public readonly string $what
|
||||
) {
|
||||
}
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
$class = $this->class === null ? '' : SourceFingerprint::shortName($this->class) . '::';
|
||||
|
||||
return $class . $this->function . '()';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user