NoopHandler.php 880 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php declare(strict_types=1);
  2. /*
  3. * This file is part of the Monolog package.
  4. *
  5. * (c) Jordi Boggiano <j.boggiano@seld.be>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Monolog\Handler;
  11. /**
  12. * No-op
  13. *
  14. * This handler handles anything, but does nothing, and does not stop bubbling to the rest of the stack.
  15. * This can be used for testing, or to disable a handler when overriding a configuration without
  16. * influencing the rest of the stack.
  17. *
  18. * @author Roel Harbers <roelharbers@gmail.com>
  19. */
  20. class NoopHandler extends Handler
  21. {
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public function isHandling(array $record): bool
  26. {
  27. return true;
  28. }
  29. /**
  30. * {@inheritdoc}
  31. */
  32. public function handle(array $record): bool
  33. {
  34. return false;
  35. }
  36. }