Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
72 lines
1.4 KiB
PHP
72 lines
1.4 KiB
PHP
<?php
|
||
|
||
declare(strict_types=1);
|
||
|
||
namespace LIT\MCP\Tests\Support;
|
||
|
||
use LIT\MCP\Abilities\Ability;
|
||
use LIT\MCP\Integrations\Divi\Release\RequiresDiviFeatures;
|
||
use WP_Error;
|
||
|
||
/** A tool that needs the given Divi features – for the feature overview, the tab and site status. */
|
||
final class FeatureFakeTool implements Ability, RequiresDiviFeatures
|
||
{
|
||
/** @param list<\LIT\MCP\Integrations\Divi\Release\DiviFeature> $features */
|
||
public function __construct(
|
||
private string $name,
|
||
private bool $direct,
|
||
private array $features
|
||
) {
|
||
}
|
||
|
||
public function name(): string
|
||
{
|
||
return $this->name;
|
||
}
|
||
|
||
public function label(): string
|
||
{
|
||
return $this->name;
|
||
}
|
||
|
||
public function description(): string
|
||
{
|
||
return '';
|
||
}
|
||
|
||
public function inputSchema(): array
|
||
{
|
||
return ['type' => 'object'];
|
||
}
|
||
|
||
public function outputSchema(): ?array
|
||
{
|
||
return null;
|
||
}
|
||
|
||
public function annotations(): array
|
||
{
|
||
return [];
|
||
}
|
||
|
||
public function isDirect(): bool
|
||
{
|
||
return $this->direct;
|
||
}
|
||
|
||
public function permission(array $input): bool|WP_Error
|
||
{
|
||
return true;
|
||
}
|
||
|
||
public function execute(array $input): mixed
|
||
{
|
||
return [];
|
||
}
|
||
|
||
public function diviFeatures(array $input): array
|
||
{
|
||
return $this->features;
|
||
}
|
||
}
|