doctrine/deprecations
Side-effect-free deprecation layer for PHP libs. Send E_USER_DEPRECATED notices to trigger_error or a PSR-3 logger, optionally just track them. Supports deduplication, suppression by identifier or package, and reporting counts of triggered deprecations.
Architecture fit: The package aligns perfectly with Laravel's PSR-3 logging infrastructure. Laravel's Monolog implementation is fully PSR-3 compliant, enabling seamless integration via enableWithPsrLogger(app('log')) without modifying core error handling. Its side-effect-free design ensures compatibility with Laravel's existing error handlers.
Integration feasibility: High. Composer installation requires minimal code changes (single-line configuration in service providers). Leverages existing Laravel logging channels and environment variables for configuration. No architectural overhauls needed.
Technical risk: Low. Designed to avoid side effects and default to safe behavior. Potential edge cases include non-standard error handler overrides in legacy Laravel apps, but this is rare. Fallback to trigger_error provides safety net.
Key questions: How to configure environment-specific deprecation handling (e.g., suppress in production but log to dedicated channel in dev)? How to integrate with Laravel's logging channels for separate deprecation monitoring? What's the process for suppressing false positives from third-party packages?
Stack fit: Excellent. Laravel's built-in Monolog logger is PSR-3 compatible, allowing direct use with Deprecation::enableWithPsrLogger(). The package's environment variable support (DOCTRINE_DEPRECATIONS) integrates cleanly with Laravel's .env system.
Migration path: 1) Install via Composer 2) Add to AppServiceProvider::boot(): Deprecation::enableWithPsrLogger(app('log')) 3) Configure logging channel in config/logging.php 4) Update PHPUnit config for deprecation assertions 5) Add suppression rules for known legacy
How can I help you explore Laravel packages today?