boson-php/uri-contracts
Framework-agnostic URI contracts for the Boson PHP ecosystem. Provides interface definitions for working with URIs in Boson and related packages, enabling consistent implementations and integrations across applications, windows, and webviews.
LaravelUriAdapter → BosonUri).UriBuilder::withScheme('https')).UriInterface vs. Laravel’s Url facade.SymfonyUriAdapter).Url facade or disable the adapter via config.Uri classes).Url::to() vs. BosonUri::fromString() in high-throughput endpoints (e.g., API rate-limited routes).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Package breaks (e.g., PHP 8.5 incompatibility) | URI generation fails in production | Use composer platform checks or fork the package. |
Adapter bugs (e.g., LaravelUriAdapter loses query params) |
Incorrect URIs in redirects/API responses | Add unit tests for adapter edge cases. |
| Team resistance to new abstraction | Slow adoption, legacy code remains | Start with opt-in usage (e.g., for new features). |
| URI validation too strict (e.g., rejects internal paths) | Breaks existing functionality | Design configurable validation rules. |
Url::to('/user?id=1') with UriBuilder::create()->path('/user')->withQuery(['id' => 1]).UriInterface for all external URIs").UriInterface implementations:
// phpstan.rules.neon
rules:
Boson\UriContracts\Type\UriInterfaceRule:
type: Boson\UriContracts\UriInterface
Url facade calls in VS Code/PHPStorm.UriInterface).How can I help you explore Laravel packages today?