Whip_MessageFormatter

A helper class to format messages.

Defined (1)

The class is defined in the following location(s).

/vendor/yoast/whip/src/Whip_MessageFormatter.php  
  1. final class Whip_MessageFormatter { 
  2.  
  3. /** 
  4. * Wraps a piece of text in HTML strong tags 
  5. * @param string $toWrap The text to wrap. 
  6. * @return string The wrapped text. 
  7. */ 
  8. public static function strong( $toWrap ) { 
  9. return '<strong>' . $toWrap . '</strong>'; 
  10.  
  11. /** 
  12. * Wraps a piece of text in HTML p tags 
  13. * @param string $toWrap The text to wrap. 
  14. * @return string The wrapped text. 
  15. */ 
  16. public static function paragraph( $toWrap ) { 
  17. return '<p>' . $toWrap . '</p>'; 
  18.  
  19. /** 
  20. * Wraps a piece of text in HTML p and strong tags 
  21. * @param string $toWrap The text to wrap. 
  22. * @return string The wrapped text. 
  23. */ 
  24. public static function strongParagraph( $toWrap ) { 
  25. return self::paragraph( self::strong( $toWrap ) );