Conversation
AkhilTreblle
approved these changes
Jun 24, 2026
Typed class constants (const int, const string, const array, const float) are a PHP 8.3+ feature. Removing the type annotations restores compatibility with PHP 8.2 as required by the project's minimum version constraint.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a full rewrite of the SDK with a huge focus on improved performance, improved networking, improved memory footprint and complelty new features.
Automated async delivery
In v5, background sending required manually opting in via config['fork_process' => true] and having pcntl available. In v6 the SDK picks the best available strategy at runtime - no configuration required.
Metadata
Attach custom key/value pairs to any request that appear on the Treblle dashboard and can be filtered and searched. Call Treblle::metadata() anywhere during the request lifecycle in a middleware, after authentication, inside a controller. Multiple calls are merged.
Circuit breaker
The SDK now tracks ingress failures and protects your application from stacking network calls against an unavailable endpoint.
PSR-15 middleware
TreblleMiddlewareintegrates directly into any PSR-15 compatible framework (Slim, Mezzio, Laravel via league/route, etc.). It reads from PSR-7 objects no output buffering and ships the payload asynchronously via a shutdown function after the response has been delivered.Route path detection
Plain PHP has no built-in router, so v6 provides two explicit mechanisms to supply the parameterised route pattern:
setRoutePath()always takes priority.New configuration API
TreblleFactory::create()is gone. Initialisation now goes throughTreblle::create()directly with a cleaner options array.For full control, construct a
TreblleConfigobject and pass it toTreblle::start().Smarter masking
No Guzzle
v6 uses native PHP curl only. If Guzzle was pulled in solely for Treblle, it can be removed:
composer remove guzzlehttp/guzzlePersistent runtime support
For long-lived processes (Swoole, RoadRunner, FrankenPHP, ReactPHP), call
Treblle::reset()at the start of each request cycle to clear all per-request state metadata, route path, cached request data, and the initialization flag so the next request starts clean.Requirements