Skip to content

Conversation

@onlime
Copy link
Contributor

@onlime onlime commented Dec 12, 2025

For enhanced DX, I have added Conditionable trait to all resource endpoints.

Usage BEFORE:

$endpoint = new LettersEndpoint($accessToken)
    ->setOrganisationId($organisationId);

if ($provider->isUsingStaging()) {
    $endpoint->useStaging();
}

with this PR:

$endpoint = new LettersEndpoint($accessToken)
    ->setOrganisationId($organisationId)
    ->when(
        $provider->isUsingStaging(),
        fn (LettersEndpoint $endpoint) => $endpoint->useStaging()
    );

providing fluent sexiness.

@pingencom pingencom merged commit bd4bf71 into pingencom:main Dec 17, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants