feat(bookstack) : add BookStackTestConnection API resource

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-15 18:09:36 +01:00
parent 245a8a932e
commit 97c6ef6a52
2 changed files with 59 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace App\State;
use ApiPlatform\Metadata\Operation;
use ApiPlatform\State\ProcessorInterface;
use ApiPlatform\State\ProviderInterface;
use App\ApiResource\BookStackTestConnection;
use App\Service\BookStackApiService;
final readonly class BookStackTestConnectionProvider implements ProviderInterface, ProcessorInterface
{
public function __construct(
private BookStackApiService $bookStackApiService,
) {}
public function provide(Operation $operation, array $uriVariables = [], array $context = []): BookStackTestConnection
{
return new BookStackTestConnection();
}
public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = []): BookStackTestConnection
{
$result = new BookStackTestConnection();
$result->success = $this->bookStackApiService->testConnection();
return $result;
}
}