Skip to main content
WritingVideosSpeakingCodeAbout

SDK Toolbox docs

Compared with Saloon

PHP ^8.316 pages

Docs for v0.0.1, from GitHub.

Pages in these docs

Saloon is good, and much of this package’s shape comes from it: request objects, a connector, fakes in tests. If you’ve used it, the toolbox will feel familiar. The differences are in what happens underneath.

Saloon 4SDK Toolbox
HTTP clientGuzzle, requiredany PSR-18 client
What send() returnsmixedthe request’s own type, checked by PHPStan
Static analysisPHPStan 7 with a baselinePHPStan max, no baseline
Retriesevery 4xx and 5xx, no method checkonly what RFC 9110 says is safe to repeat, honouring Retry-After, with jitter, a deadline and Idempotency-Key
Rate limitsa plugin, reading Retry-AfterIETF RateLimit and X-RateLimit-* read on every response, and an optional throttle
Errorsa class per statusa class per status, plus RFC 9457 problems mapped to your own exceptions
Cachinga plugin, with a fixed lifetimeRFC 9111: ETags, 304s, Vary, keyed on credentials
Paginationa plugin, reading the bodyLink headers and body strategies, in bounded memory
Configurationtraits booted by name, mutable properties, static globalsconstructor arguments and immutable copies
Async and poolsyes, on Guzzle promisesnot yet

Saloon has async requests, request pools and a Laravel plugin with make: commands, and the toolbox doesn’t, yet. If you need concurrent requests today, use Saloon.

Saloon’s v4 release fixed three security holes that came from convenience features: unserializing stored tokens, absolute URLs overriding the base URL, and fixture names that could reach outside their directory. The toolbox was designed with those in mind; Security covers how.