mirror of
https://github.com/doctrine/doctrine-website.git
synced 2026-03-23 22:32:11 +01:00
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.
29 lines
744 B
PHP
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),
|
|
]);
|
|
}
|
|
}
|