DumperInterface.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. * @param string $type The PHP type of the value being dumped
  22. * @param string|int|float|bool $value The scalar value being dumped
  23. */
  24. public function dumpScalar(Cursor $cursor, string $type, $value);
  25. /**
  26. * Dumps a string.
  27. *
  28. * @param string $str The string being dumped
  29. * @param bool $bin Whether $str is UTF-8 or binary encoded
  30. * @param int $cut The number of characters $str has been cut by
  31. */
  32. public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut);
  33. /**
  34. * Dumps while entering an hash.
  35. *
  36. * @param int $type A Cursor::HASH_* const for the type of hash
  37. * @param string|int $class The object class, resource type or array count
  38. * @param bool $hasChild When the dump of the hash has child item
  39. */
  40. public function enterHash(Cursor $cursor, int $type, $class, bool $hasChild);
  41. /**
  42. * Dumps while leaving an hash.
  43. *
  44. * @param int $type A Cursor::HASH_* const for the type of hash
  45. * @param string|int $class The object class, resource type or array count
  46. * @param bool $hasChild When the dump of the hash has child item
  47. * @param int $cut The number of items the hash has been cut by
  48. */
  49. public function leaveHash(Cursor $cursor, int $type, $class, bool $hasChild, int $cut);
  50. }