DumperInterface.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. namespace Symfony\Component\VarDumper\Cloner;
  11. /**
  12. * DumperInterface used by Data objects.
  13. *
  14. * @author Nicolas Grekas <p@tchwork.com>
  15. */
  16. interface DumperInterface
  17. {
  18. /**
  19. * Dumps a scalar value.
  20. */
  21. public function dumpScalar(Cursor $cursor, string $type, string|int|float|bool|null $value);
  22. /**
  23. * Dumps a string.
  24. *
  25. * @param string $str The string being dumped
  26. * @param bool $bin Whether $str is UTF-8 or binary encoded
  27. * @param int $cut The number of characters $str has been cut by
  28. */
  29. public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut);
  30. /**
  31. * Dumps while entering an hash.
  32. *
  33. * @param int $type A Cursor::HASH_* const for the type of hash
  34. * @param string|int|null $class The object class, resource type or array count
  35. * @param bool $hasChild When the dump of the hash has child item
  36. */
  37. public function enterHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild);
  38. /**
  39. * Dumps while leaving an hash.
  40. *
  41. * @param int $type A Cursor::HASH_* const for the type of hash
  42. * @param string|int|null $class The object class, resource type or array count
  43. * @param bool $hasChild When the dump of the hash has child item
  44. * @param int $cut The number of items the hash has been cut by
  45. */
  46. public function leaveHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild, int $cut);
  47. }