Configure deprecation handling for consumers
1.1.xAs a consumer (application developer), you can choose how deprecations are handled using the extit{\Doctrine\Deprecations\Deprecation} class or the DOCTRINE_DEPRECATIONS environment variable.
Modes of Operation
- PSR-3 Logging (Recommended): Sends deprecations to a PSR-3 compatible logger.
- Method:
\Doctrine\Deprecations\Deprecation::enableWithPsrLogger($logger)
- Method:
- Trigger Error: Sends deprecations via
trigger_error($message, E_USER_DEPRECATED).- Method:
\Doctrine\Deprecations\Deprecation::enableWithTriggerError() - Environment Variable:
DOCTRINE_DEPRECATIONS=trigger
- Method:
- Tracking Only: Enables tracking of deprecations without logging or triggering errors. This allows you to inspect them later.
- Method:
\Doctrine\Deprecations\Deprecation::enableTrackingDeprecations() - Environment Variable:
DOCTRINE_DEPRECATIONS=track
- Method:
All modes enable tracking, allowing you to retrieve the list of triggered deprecations.