Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
47 lines
1.6 KiB
PHP
47 lines
1.6 KiB
PHP
<?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 implements Requirement
|
||
{
|
||
/**
|
||
* @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).
|
||
* @param list<DiviFeature> $features [] = the default of the manifest.
|
||
*/
|
||
public function __construct(
|
||
public readonly string $id,
|
||
public readonly string $file,
|
||
public readonly string $function,
|
||
public readonly ?string $class,
|
||
public readonly string $what,
|
||
private readonly array $features = []
|
||
) {
|
||
}
|
||
|
||
public function features(): array
|
||
{
|
||
return $this->features;
|
||
}
|
||
|
||
public function label(): string
|
||
{
|
||
$class = $this->class === null ? '' : SourceFingerprint::shortName($this->class) . '::';
|
||
|
||
return $class . $this->function . '()';
|
||
}
|
||
}
|