cybercog/youtrack-rest-php
A PHP client for the YouTrack REST API that wraps issues, projects, users, and time tracking in an object-oriented interface. Works with YouTrack Cloud and standalone instances, using PSR-compatible HTTP clients and typed response models. Ideal for integrating YouTrack issue tracking into PHP applic...
YouTrackClient + TokenAuthorizer covers the create-issue path with ~no infrastructure.YouTrackResponse::toArray() makes read-path work straightforward.TokenAuthorizer (Bearer/service-account token — choose this) and CookieAuthorizer/CookieAuthenticator (username/password with cookie caching — legacy, avoid for new work). That decision should be made once, documented, and reused across every integration.InvalidAuthorizationToken for 401, AuthenticationException for 403, ClientException for everything else) let you define retry, alerting, and dead-letter behavior per failure class rather than parsing status codes ad hoc.Adopt when all of the following hold:
readonly constructor promotion, declare(strict_types=1) everywhere, PHPStan level 8. That is a genuinely low-maintenance dependency profile.MockHandler pattern and the HasFakeHttpResponses trait mean your integration tests don't hit a live YouTrack instance.Look elsewhere (or budget for a fork) when:
contracts/ before committing scope.For executives — one paragraph. We can integrate our PHP platform with JetBrains YouTrack in days instead of weeks by adopting a small, MIT-licensed, actively released open-source client rather than building and maintaining REST plumbing ourselves. It removes the recurring cost of tracking YouTrack API changes and lets our engineers spend their time on business logic — automated defect intake, support-ticket synchronization, and status dashboards — instead of HTTP mechanics. The cost is a dependency with a small community, which we mitigate by pinning the version, keeping our own thin abstraction in front of it, and retaining the option to fork or replace behind that seam. Net: low-cost, low-lock-in, reversible.
For engineering — the technical case.
strict_types, readonly promoted properties, PSR-12, PHPStan level 8. No legacy patterns to work around.contracts/ holds interfaces, src/ holds implementations, so you depend on YouTrackClientInterface and mock it in tests. GuzzleHttpClient is an adapter — swap the transport without touching call sites.InvalidAuthorizationToken, 403 → AuthenticationException, otherwise ClientException), so retry and alerting policies attach to types, not status-code strings.HasFakeHttpResponses + Guzzle MockHandler for unit-level isolation, plus env-var-driven integration tests (YOUTRACK_BASE_URI, YOUTRACK_TOKEN, YOUTRACK_AUTH, YOUTRACK_PROJECT) for a real instance in CI.Risks to state openly.
contracts/; anything missing means writing an adapter method, not switching libraries.TokenAuthorizer with a scoped service account. Avoid CookieAuthenticator (username/password with cookie caching) except where token issuance is genuinely unavailable, and store credentials in your secret manager either way.How can I help you explore Laravel packages today?