You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.2 KiB

  1. <?php namespace Sensory5\Shortcode\Classes;
  2. /**
  3. * @author Tomasz Kowalczyk <tomasz@kowalczyk.cc>
  4. */
  5. interface ShortcodeInterface
  6. {
  7. /**
  8. * Returns new instance of given shortcode with changed content
  9. *
  10. * @param string $content
  11. *
  12. * @return self
  13. */
  14. public function withContent($content);
  15. /**
  16. * Returns shortcode name
  17. *
  18. * @return string
  19. */
  20. public function getName();
  21. /**
  22. * Returns associative array(name => value) of shortcode parameters
  23. *
  24. * @return array
  25. */
  26. public function getParameters();
  27. /**
  28. * Returns parameter value using its name, will return null for parameter
  29. * without value
  30. *
  31. * @param string $name Parameter name
  32. * @param null $default Value returned if there is no parameter with given name
  33. *
  34. * @return mixed
  35. */
  36. public function getParameter($name, $default = null);
  37. /**
  38. * Returns shortcode content (data between opening and closing tag). Null
  39. * means that shortcode had no content (was self closing), do not confuse
  40. * that with empty string (hint: use strict comparison operator ===).
  41. *
  42. * @return string|null
  43. */
  44. public function getContent();
  45. }