You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
1008 B

3 years ago
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. if (!function_exists('trigger_deprecation')) {
  11. /**
  12. * Triggers a silenced deprecation notice.
  13. *
  14. * @param string $package The name of the Composer package that is triggering the deprecation
  15. * @param string $version The version of the package that introduced the deprecation
  16. * @param string $message The message of the deprecation
  17. * @param mixed ...$args Values to insert in the message using printf() formatting
  18. *
  19. * @author Nicolas Grekas <p@tchwork.com>
  20. */
  21. function trigger_deprecation(string $package, string $version, string $message, ...$args): void
  22. {
  23. @trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED);
  24. }
  25. }