Files
archived-doctrine-website/lib/Controllers/DocumentationController.php
Christophe Coevoet 495b4ac8f4 Inline the static website generator in the website repo
Maintaining a standalone static website generator project that is not
reused outside our website adds maintenance overhead. For instance,
support for using `phpdocumentor/guides` was implemented in the website
repo rather than the standalone generator package, which was still using
the `doctrine/rst-parser` package that we want to abandon.
2025-10-09 21:46:37 +02:00

29 lines
744 B
PHP

<?php
declare(strict_types=1);
namespace Doctrine\Website\Controllers;
use Doctrine\Website\Model\Project;
use Doctrine\Website\Repositories\ProjectRepository;
use Doctrine\Website\StaticGenerator\Controller\Response;
final readonly class DocumentationController
{
/** @param ProjectRepository<Project> $projectRepository */
public function __construct(
private ProjectRepository $projectRepository,
) {
}
public function view(string $docsSlug, string $docsVersion): Response
{
$project = $this->projectRepository->findOneByDocsSlug($docsSlug);
return new Response([
'project' => $project,
'projectVersion' => $project->getVersion($docsVersion),
]);
}
}