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:
@@ -4,8 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace GitContributionGraph\Service\Provider;
|
||||
|
||||
/** Result of probing a single provider, as reported by the /health endpoint. */
|
||||
final class ProviderStatus
|
||||
{
|
||||
/**
|
||||
* @param string $name provider identifier, e.g. "github"
|
||||
* @param ProviderStatusType $status overall outcome of the probe
|
||||
* @param ?ProviderErrorCode $error classified error code, set only when $status is Error
|
||||
* @param ?string $message human-readable error detail, set only when $status is Error
|
||||
*/
|
||||
public function __construct(
|
||||
public readonly string $name,
|
||||
public readonly ProviderStatusType $status,
|
||||
@@ -13,7 +20,11 @@ final class ProviderStatus
|
||||
public readonly ?string $message = null,
|
||||
) {}
|
||||
|
||||
/** @return array<string, string> */
|
||||
/**
|
||||
* Converts to the array shape used in the /health JSON response, omitting error/message when unset.
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function toArray(): array
|
||||
{
|
||||
$data = ['status' => $this->status->value];
|
||||
|
||||
Reference in New Issue
Block a user