Thanks for considering a contribution to the Openstatus PHP SDK.
Requires PHP 8.4+ and Composer.
composer install
composer test # phpunit
composer analyse # phpstan level 8
composer fmt # php-cs-fixerThe PHP message classes under src/Gen/ are generated from the pinned Buf
archive listed in scripts/regen.sh. Never edit src/Gen/ by hand.
- Find the latest archive version at https://buf.build/openstatus/api/sdks/main:protocolbuffers/php.
- Edit
BUF_PHP_VERSIONinscripts/regen.sh. - Run
composer regen. - Commit both
scripts/regen.shand the resultingsrc/Gen/diff in a single PR.
The weekly regen.yml workflow does this automatically when a new version is
published; you only need to do it manually if you want to ship a schema change
before the next cron run.
When the schema gains a new RPC, add a single dispatch method to the relevant
file under src/Services/. The method takes the typed request message and an
optional array $headers = [], and returns the typed response message. Match
the existing pattern; one method per RPC, no abstractions.
- PSR-12 plus
declare(strict_types=1);on every file. - All hand-written public classes are
final. - No
mixedtypes insrc/(PHPStan level 8 enforces this). - Run
composer fmtbefore opening a PR.
- Unit tests under
tests/Unit/run on every PR. They use a PSR-18 mock client and never touch the real API. - Integration tests under
tests/Integration/are gated onOPENSTATUS_API_KEYand run locally before tagging a release. They are not wired into CI.