Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | /** |
3 | * |
4 | * This file is part of the phpBB Forum Software package. |
5 | * |
6 | * @copyright (c) phpBB Limited <https://www.phpbb.com> |
7 | * @license GNU General Public License, version 2 (GPL-2.0) |
8 | * |
9 | * For full copyright and license information, please see |
10 | * the docs/CREDITS.txt file. |
11 | * |
12 | */ |
13 | |
14 | namespace phpbb\textformatter; |
15 | |
16 | interface parser_interface |
17 | { |
18 | /** |
19 | * Parse given text |
20 | * |
21 | * @param string $text |
22 | * @return string |
23 | */ |
24 | public function parse($text); |
25 | |
26 | /** |
27 | * Disable a specific BBCode |
28 | * |
29 | * @param string $name BBCode name |
30 | * @return null |
31 | */ |
32 | public function disable_bbcode($name); |
33 | |
34 | /** |
35 | * Disable BBCodes in general |
36 | */ |
37 | public function disable_bbcodes(); |
38 | |
39 | /** |
40 | * Disable the censor |
41 | */ |
42 | public function disable_censor(); |
43 | |
44 | /** |
45 | * Disable magic URLs |
46 | */ |
47 | public function disable_magic_url(); |
48 | |
49 | /** |
50 | * Disable smilies |
51 | */ |
52 | public function disable_smilies(); |
53 | |
54 | /** |
55 | * Enable a specific BBCode |
56 | * |
57 | * @param string $name BBCode name |
58 | * @return null |
59 | */ |
60 | public function enable_bbcode($name); |
61 | |
62 | /** |
63 | * Enable BBCodes in general |
64 | */ |
65 | public function enable_bbcodes(); |
66 | |
67 | /** |
68 | * Enable the censor |
69 | */ |
70 | public function enable_censor(); |
71 | |
72 | /** |
73 | * Enable magic URLs |
74 | */ |
75 | public function enable_magic_url(); |
76 | |
77 | /** |
78 | * Enable smilies |
79 | */ |
80 | public function enable_smilies(); |
81 | |
82 | /** |
83 | * Get the list of errors that were generated during last parsing |
84 | * |
85 | * @return array[] Array of arrays. Each array contains a lang string at index 0 plus any number |
86 | * of optional parameters |
87 | */ |
88 | public function get_errors(); |
89 | |
90 | /** |
91 | * Set a variable to be used by the parser |
92 | * |
93 | * - max_font_size |
94 | * - max_smilies |
95 | * - max_urls |
96 | * |
97 | * @param string $name |
98 | * @param mixed $value |
99 | * @return null |
100 | */ |
101 | public function set_var($name, $value); |
102 | |
103 | /** |
104 | * Set multiple variables to be used by the parser |
105 | * |
106 | * @param array $vars Associative array of [name => value] |
107 | * @return null |
108 | */ |
109 | public function set_vars(array $vars); |
110 | } |