1 | <?php |
||
15 | class trim_tools |
||
16 | { |
||
17 | /** @var array An array of trim tools */ |
||
18 | protected $trim_tools; |
||
19 | |||
20 | /** |
||
21 | * Constructor |
||
22 | * |
||
23 | * @param manager $manager |
||
24 | * @access public |
||
25 | */ |
||
26 | public function __construct(manager $manager) |
||
30 | |||
31 | /** |
||
32 | * Trim and clean text |
||
33 | * |
||
34 | * @param string $message Message text |
||
35 | * @param int $length The length to trim text to |
||
36 | * @return string Trimmed message text |
||
37 | * @access protected |
||
38 | */ |
||
39 | public function trim_text($message, $length) |
||
60 | |||
61 | /** |
||
62 | * Convert and preserve line breaks |
||
63 | * http://stackoverflow.com/questions/816085/removing-redundant-line-breaks-with-regular-expressions |
||
64 | * |
||
65 | * @param string $message Message text |
||
66 | * @return string Message text with line breaks |
||
67 | * @access protected |
||
68 | */ |
||
69 | protected function tp_nl2br($message) |
||
73 | } |
||
74 |