DevelDumperInterface.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. namespace Drupal\devel;
  3. /**
  4. * Base interface definition for DevelDumper plugins.
  5. *
  6. * @see \Drupal\devel\Annotation\DevelDumper
  7. * @see \Drupal\devel\DevelDumperPluginManager
  8. * @see \Drupal\devel\DevelDumperBase
  9. * @see plugin_api
  10. */
  11. interface DevelDumperInterface {
  12. /**
  13. * Dumps information about a variable.
  14. *
  15. * @param mixed $input
  16. * The variable to dump.
  17. * @param string $name
  18. * (optional) The label to output before variable, defaults to NULL.
  19. */
  20. public function dump($input, $name = NULL);
  21. /**
  22. * Returns a string representation of a variable.
  23. *
  24. * @param mixed $input
  25. * The variable to export.
  26. * @param string $name
  27. * (optional) The label to output before variable, defaults to NULL.
  28. *
  29. * @return string
  30. * String representation of a variable.
  31. */
  32. public function export($input, $name = NULL);
  33. /**
  34. * Returns a string representation of a variable wrapped in a render array.
  35. *
  36. * @param mixed $input
  37. * The variable to export.
  38. * @param string $name
  39. * (optional) The label to output before variable, defaults to NULL.
  40. *
  41. * @return array
  42. * String representation of a variable wrapped in a render array.
  43. */
  44. public function exportAsRenderable($input, $name = NULL);
  45. /**
  46. * Checks if requirements for this plugin are satisfied.
  47. *
  48. * @return bool
  49. * TRUE is requirements are satisfied, FALSE otherwise.
  50. */
  51. public static function checkRequirements();
  52. }