docs(phpdoc): document public methods across src/

Add professional PHPDoc (summary + @param/@return) to the remaining
public methods that had none or only partial coverage: GraphController's
actions, ContributionStore's accessors, SvgRenderer's render() and
private helpers (with concrete array-shape annotations), ProbeTrait,
ProviderHealthChecker, ProviderStatus, and the Contribution entity.
Also adds the matching @return shapes on SvgRendererTest's data
providers.
This commit is contained in:
2026-07-12 23:43:31 +02:00
parent 8e349c961b
commit 9c028aaf5e
8 changed files with 89 additions and 6 deletions
+18 -2
View File
@@ -34,8 +34,12 @@ final class GraphController
}
/**
* Query parameters:
* theme string dark|light (default: dark)
* Serves the contribution heatmap SVG, from a 1-hour cache on repeat requests.
*
* Rejects requests to disallowed hosts (ALLOWED_HOSTS env) with a 403.
*
* @param Request $request query parameter `theme` selects "dark" (default) or "light"
* @return Response image/svg+xml body, cacheable for 3600s
*/
#[Route('/graph.svg', name: 'contribution_graph', methods: ['GET'])]
public function graph(Request $request): Response
@@ -66,6 +70,12 @@ final class GraphController
]);
}
/**
* Redirects "/" to "/graph.svg", forwarding any query string (e.g. ?theme=light).
*
* @param Request $request incoming request whose query string is preserved
* @return RedirectResponse 302 redirect to /graph.svg
*/
#[Route('/', name: 'index', methods: ['GET'])]
public function index(Request $request): RedirectResponse
{
@@ -75,6 +85,12 @@ final class GraphController
return new RedirectResponse($url, 302);
}
/**
* Reports per-provider connectivity status as JSON.
*
* @return Response 200 with {"status":"ok",...} or 503 with {"status":"degraded",...}
* when any configured provider's probe reports an error
*/
#[Route('/health', name: 'health', methods: ['GET'])]
public function health(): Response
{