LogRecord.php 983 B

12345678910111213141516171819202122232425262728293031323334
  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;
  11. use ArrayAccess;
  12. /**
  13. * Monolog log record interface for forward compatibility with Monolog 3.0
  14. *
  15. * This is just present in Monolog 2.4+ to allow interoperable code to be written against
  16. * both versions by type-hinting arguments as `array|\Monolog\LogRecord $record`
  17. *
  18. * Do not rely on this interface for other purposes, and do not implement it.
  19. *
  20. * @author Jordi Boggiano <j.boggiano@seld.be>
  21. * @template-extends \ArrayAccess<'message'|'level'|'context'|'level_name'|'channel'|'datetime'|'extra'|'formatted', mixed>
  22. * @phpstan-import-type Record from Logger
  23. */
  24. interface LogRecord extends \ArrayAccess
  25. {
  26. /**
  27. * @phpstan-return Record
  28. */
  29. public function toArray(): array;
  30. }