TextWrapper.php 532 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace Drupal\Tests\Component\Utility;
  3. /**
  4. * Used by SafeMarkupTest to test that a class with a __toString() method works.
  5. */
  6. class TextWrapper {
  7. /**
  8. * The text value.
  9. *
  10. * @var string
  11. */
  12. protected $text = '';
  13. /**
  14. * Constructs a \Drupal\Tests\Component\Utility\TextWrapper
  15. *
  16. * @param string $text
  17. */
  18. public function __construct($text) {
  19. $this->text = $text;
  20. }
  21. /**
  22. * Magic method
  23. *
  24. * @return string
  25. */
  26. public function __toString() {
  27. return $this->text;
  28. }
  29. }