-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEscaperInterface.php
120 lines (105 loc) · 2.64 KB
/
EscaperInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?php
namespace NatePage\EasyHtmlElement;
interface EscaperInterface
{
/**
* Apply escaping strategies to an element.
*
* @param ElementInterface $element The element to escape
*
* @return ElementInterface
*/
public function escape(ElementInterface $element): ElementInterface;
/**
* Apply escaping strategies on element attributes.
*
* @param array $attributes The attributes array to escape
*
* @return array
*/
public function escapeAttributes(array $attributes): array;
/**
* Apply url escaping strategy on an url parameter.
*
* @param string $parameter The parameter to escape
*
* @return string
*/
public function escapeUrlParameter(string $parameter): string;
/**
* Get the urls attributes.
*
* @return array
*/
public function getUrlsAttributes(): array;
/**
* Determine if html escaping strategy is applied.
*
* @param bool $escapeHtml
*
* @return EscaperInterface
*/
public function setEscapeHtml(bool $escapeHtml = true): self;
/**
* Check if html escaping strategy is applied.
*
* @return bool
*/
public function isEscapeHtml(): bool;
/**
* Determine if html attributes escaping strategy is applied.
*
* @param bool $escapeHtmlAttr
*
* @return EscaperInterface
*/
public function setEscapeHtmlAttr(bool $escapeHtmlAttr = true): self;
/**
* Check if html attributes escaping strategy is applied.
*
* @return bool
*/
public function isEscapeHtmlAttr(): bool;
/**
* Determine if css escaping strategy is applied.
*
* @param bool $escapeCss
*
* @return EscaperInterface
*/
public function setEscapeCss(bool $escapeCss = true): self;
/**
* Check if css escaping strategy is applied.
*
* @return bool
*/
public function isEscapeCss(): bool;
/**
* Determine if javascript escaping strategy is applied.
*
* @param bool $escapeJs
*
* @return EscaperInterface
*/
public function setEscapeJs(bool $escapeJs = true): self;
/**
* Check if javascript escaping strategy is applied.
*
* @return bool
*/
public function isEscapeJs(): bool;
/**
* Determine if urls escaping strategy is applied.
*
* @param bool $escapeUrl
*
* @return EscaperInterface
*/
public function setEscapeUrl(bool $escapeUrl = true): self;
/**
* Check if urls escaping strategy is applied.
*
* @return bool
*/
public function isEscapeUrl(): bool;
}