phphd/exception-toolkit
A PHP/Laravel exception toolkit for centralizing error handling: customize reporting, rendering, logging, and response formatting for exceptions. It helps turn thrown errors into consistent, actionable responses and cleaner application code.
Architecture fit
phphd/exception-toolkit is a PHP exception-handling utility package. The 1.2.0 changes expose PhdExceptionToolkitExtension::getContainer() and add PhdExceptionToolkitExtension::configureContainer(), which is the classic Symfony DependencyInjection Extension shape, not a Laravel ServiceProvider shape. Treat this as a framework-agnostic PHP library with a Symfony-first DI surface, not a Laravel-native package.Illuminate\Contracts\Container\Container; there is no Extension/configureContainer concept. Any Laravel integration requires a thin adapter ServiceProvider that maps the extension's configuration into Laravel config and binding.failed() hook). It is lowest in codebases with ad-hoc try/catch and no shared error taxonomy.Integration feasibility
Extension is instantiated by the framework.getContainer()/configureContainer() is only meaningful if you install and drive the Symfony DI bridge yourself — a non-trivial amount of plumbing for a package of this scope. Expect to consume the underlying exception logic directly rather than the extension API.Technical risk
getContainer() becoming publicly usable invites consumers to pull dependencies out of the container at arbitrary call sites. That is a maintainability liability and a likely future deprecation vector; it also makes static analysis and test isolation harder.phphd appears to be a small-maintainer/vendor namespace; bus-factor and long-term maintenance are unverified.configureContainer() implies configuration is now settable in two places (framework config vs. programmatic). Divergent precedence between the two is a common source of environment-specific bugs.^1.2 and lock file; do not float.Key questions
Extension mandatory for the core exception pipeline? This determines whether a Laravel adapter is 20 lines or 200.composer.json? Any Laravel support claimed explicitly?configureContainer() accept, and does it override or merge with framework-level configuration? Is there a documented precedence?getContainer() intended as public API (semver-stable) or an escape hatch that may be closed in 2.0? A deprecation here would be a breaking change for anyone who adopts it now.Stack fit
App\Exceptions\Handler / bootstrap/app.php exception configuration, keeping framework concerns (HTTP status mapping, localization) in your own middleware. Do not let the library define your HTTP contract.Migration path
ExceptionToolkitServiceProvider that binds a single ExceptionClassifier-style interface, and forbid direct container access from application code via static analysis (PHPStan/Psalm rule or a review checklist). This isolates the 1.2.0 container seam and makes a future swap or 2.0 upgrade a one-file change.^1.2 with no code changes required — the additions are additive. Adopt configureContainer() only if you currently configure via the framework; otherwise leave it alone and avoid dual-source configuration.Compatibility
composer.json PHP constraint against your runtime before pinning; PHP-version skew is the most common silent blocker on small packages.Extension registration and the package's.configureContainer() that is not idempotent is a real risk under persistent processes.Sequencing
getContainer()/configureContainer(). Default position: do not adopt — the value is marginal and the coupling is permanent.Maintenance
getContainer() directly across many call sites — that is the failure mode to design out on day one.configureContainer() must be documented in your own runbook; otherwise it will be rediscovered during an incident.Support
Scaling
Failure modes
unknown bucket that reports and re-raises where appropriate.configureContainer() and framework config across environments.Ramp-up
getContainer() directly outside the adapter should be rejected. Making this an explicit, written convention at adoption time is cheaper than enforcing it retroactively.^1.2, integrate behind a single provider, use the exception logic but not the new extension/container surface, and re-evaluate if a 1.3+/2.0 release adds documented Laravel support or deprecates getContainer().How can I help you explore Laravel packages today?