1 | <?php |
||
23 | class HtmlEscaper extends AbstractEscaper |
||
24 | { |
||
25 | /** |
||
26 | * |
||
27 | * Flags for `htmlspecialchars()`. |
||
28 | * |
||
29 | * @var mixed |
||
30 | * |
||
31 | */ |
||
32 | protected $flags = ENT_QUOTES; |
||
33 | |||
34 | /** |
||
35 | * |
||
36 | * Constructor. |
||
37 | * |
||
38 | * @param int $flags Flags for `htmlspecialchars()`. |
||
39 | * |
||
40 | * @param string $encoding The encoding to use for raw and escaped strings. |
||
41 | * |
||
42 | */ |
||
43 | 114 | public function __construct($flags = null, $encoding = null) |
|
55 | |||
56 | /** |
||
57 | * |
||
58 | * Escapes an HTML value. |
||
59 | * |
||
60 | * @param mixed $raw The value to be escaped. |
||
61 | * |
||
62 | * @return mixed The escaped value. |
||
63 | * |
||
64 | */ |
||
65 | 78 | public function __invoke($raw) |
|
79 | |||
80 | /** |
||
81 | * |
||
82 | * Sets the flags for `htmlspecialchars()`. |
||
83 | * |
||
84 | * @param int $flags The flags for `htmlspecialchars()`. |
||
85 | * |
||
86 | * @return null |
||
87 | * |
||
88 | */ |
||
89 | 114 | public function setFlags($flags) |
|
93 | |||
94 | /** |
||
95 | * |
||
96 | * Gets the flags for `htmlspecialchars()`. |
||
97 | * |
||
98 | * @return int |
||
99 | * |
||
100 | */ |
||
101 | 3 | public function getFlags() |
|
105 | } |
||
106 |