暂无描述

DumperInterface.php 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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, $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, $str, $bin, $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, $type, $class, $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, $type, $class, $hasChild, $cut);
  50. }