Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report

doctrine/deprecations 1.1.3

A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.
Package summary
Share
0
issues
0
licenses
Package created
10 Jul 2020
Version published
30 Jan 2024
Maintainers
1
Total deps
0
Direct deps
0
License
MIT
Generating a report...
Hold on while we generate a fresh audit report for this package.

Frequently Asked Questions

What does doctrine/deprecations do?

Doctrine/Deprecations is a small package that operates as a layer above trigger_error(E_USER_DEPRECATED) or PSR-3 logging. This PHP library provides additional functionality with less side-effects, allowing for the ability to disable all or specific deprecations for packages. This helps developers in dealing with deprecated code and preparing for future updates, in a more efficient, less error-prone way.

How do you use doctrine/deprecations?

Using Doctrine/Deprecations involves several key methods and environments settings. At the basic level, to enable Doctrine deprecations to be sent to a PSR3 logger, you can run:

\Doctrine\Deprecations\Deprecation::enableWithPsrLogger($logger);

To allow the deprecations to be sent as @trigger_error messages, you should set the DOCTRINE_DEPRECATIONS environment variable to 'trigger', or simply call:

\Doctrine\Deprecations\Deprecation::enableWithTriggerError();

To disable deprecations for specific packages or identifiers, use the ignoreDeprecations and ignorePackage methods as shown:

\Doctrine\Deprecations\Deprecation::ignoreDeprecations("https://link/to/deprecations-description-identifier");
\Doctrine\Deprecations\Deprecation::ignorePackage("doctrine/orm");

To trigger a deprecation, the trigger and triggerIfCalledFromOutside methods can be used:

\Doctrine\Deprecations\Deprecation::trigger(
    "doctrine/orm",
    "https://link/to/deprecations-description",
    "message"
);

Note: Replace "https://link/to/deprecations-description" and "message" with the appropriate deprecation description and message.

Where are the doctrine/deprecations docs?

The documentation for Doctrine/Deprecations can be found within the README file in the package's GitHub repository at https://github.com/doctrine/deprecations. This documentation provides a comprehensive view of the functionalities available in the library, useful code snippets, and guidelines for usage scenarios including PHPUnit tests.