Stringifier.php 664 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /*
  3. * This file is part of Respect/Stringifier.
  4. *
  5. * (c) Henrique Moody <henriquemoody@gmail.com>
  6. *
  7. * For the full copyright and license information, please view the "LICENSE.md"
  8. * file that was distributed with this source code.
  9. */
  10. declare(strict_types=1);
  11. namespace Respect\Stringifier;
  12. interface Stringifier
  13. {
  14. /**
  15. * Converts the value into string if possible.
  16. *
  17. * @param mixed $raw The raw value to be converted.
  18. * @param int $depth The current depth of the conversion.
  19. *
  20. * @return null|string Returns NULL when the conversion is not possible.
  21. */
  22. public function stringify($raw, int $depth): ?string;
  23. }