Skip to content

Commit 9b32ba7

Browse files
authored
Merge pull request #218 from gsteel/v2/htmlentities-deprecations
Deprecate getters and setters in the `HtmlEntities` filter
2 parents f9e9083 + 08aad80 commit 9b32ba7

File tree

2 files changed

+54
-5
lines changed

2 files changed

+54
-5
lines changed

psalm-baseline.xml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1249,6 +1249,20 @@
12491249
<DeprecatedClass>
12501250
<code><![CDATA[AbstractFilter]]></code>
12511251
</DeprecatedClass>
1252+
<DeprecatedMethod>
1253+
<code><![CDATA[getDoubleQuote]]></code>
1254+
<code><![CDATA[getDoubleQuote]]></code>
1255+
<code><![CDATA[getEncoding]]></code>
1256+
<code><![CDATA[getEncoding]]></code>
1257+
<code><![CDATA[getEncoding]]></code>
1258+
<code><![CDATA[getEncoding]]></code>
1259+
<code><![CDATA[getQuoteStyle]]></code>
1260+
<code><![CDATA[getQuoteStyle]]></code>
1261+
<code><![CDATA[setDoubleQuote]]></code>
1262+
<code><![CDATA[setEncoding]]></code>
1263+
<code><![CDATA[setEncoding]]></code>
1264+
<code><![CDATA[setQuoteStyle]]></code>
1265+
</DeprecatedMethod>
12521266
<DocblockTypeContradiction>
12531267
<code><![CDATA[is_array($options)]]></code>
12541268
</DocblockTypeContradiction>
@@ -2061,8 +2075,8 @@
20612075
</InvalidArgument>
20622076
<PossiblyUnusedMethod>
20632077
<code><![CDATA[returnInvalidFilterInputProvider]]></code>
2064-
<code><![CDATA[returnValidFilterInputProvider]]></code>
20652078
<code><![CDATA[returnUnfilteredDataProvider]]></code>
2079+
<code><![CDATA[returnValidFilterInputProvider]]></code>
20662080
</PossiblyUnusedMethod>
20672081
</file>
20682082
<file src="test/File/RenameUploadTest.php">
@@ -2134,6 +2148,25 @@
21342148
</PossiblyUnusedMethod>
21352149
</file>
21362150
<file src="test/HtmlEntitiesTest.php">
2151+
<DeprecatedMethod>
2152+
<code><![CDATA[getCharSet]]></code>
2153+
<code><![CDATA[getCharSet]]></code>
2154+
<code><![CDATA[getDoubleQuote]]></code>
2155+
<code><![CDATA[getDoubleQuote]]></code>
2156+
<code><![CDATA[getEncoding]]></code>
2157+
<code><![CDATA[getQuoteStyle]]></code>
2158+
<code><![CDATA[getQuoteStyle]]></code>
2159+
<code><![CDATA[getQuoteStyle]]></code>
2160+
<code><![CDATA[setCharSet]]></code>
2161+
<code><![CDATA[setCharSet]]></code>
2162+
<code><![CDATA[setDoubleQuote]]></code>
2163+
<code><![CDATA[setDoubleQuote]]></code>
2164+
<code><![CDATA[setQuoteStyle]]></code>
2165+
<code><![CDATA[setQuoteStyle]]></code>
2166+
<code><![CDATA[setQuoteStyle]]></code>
2167+
<code><![CDATA[setQuoteStyle]]></code>
2168+
<code><![CDATA[setQuoteStyle]]></code>
2169+
</DeprecatedMethod>
21372170
<PossiblyUnusedMethod>
21382171
<code><![CDATA[returnUnfilteredDataProvider]]></code>
21392172
</PossiblyUnusedMethod>

src/HtmlEntities.php

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ public function __construct($options = [])
9494
/**
9595
* Returns the quoteStyle option
9696
*
97+
* @deprecated Since 2.40.0. This method will be removed in 3.0 without replacement
98+
*
9799
* @return int
98100
*/
99101
public function getQuoteStyle()
@@ -104,7 +106,9 @@ public function getQuoteStyle()
104106
/**
105107
* Sets the quoteStyle option
106108
*
107-
* @param int $quoteStyle
109+
* @deprecated Since 2.40.0. This method will be removed in 3.0. Set options during construction instead
110+
*
111+
* @param int $quoteStyle
108112
* @return self Provides a fluent interface
109113
*/
110114
public function setQuoteStyle($quoteStyle)
@@ -116,6 +120,8 @@ public function setQuoteStyle($quoteStyle)
116120
/**
117121
* Get encoding
118122
*
123+
* @deprecated Since 2.40.0. This method will be removed in 3.0 without replacement
124+
*
119125
* @return string
120126
*/
121127
public function getEncoding()
@@ -126,7 +132,9 @@ public function getEncoding()
126132
/**
127133
* Set encoding
128134
*
129-
* @param string $value
135+
* @deprecated Since 2.40.0. This method will be removed in 3.0. Set options during construction instead
136+
*
137+
* @param string $value
130138
* @return self
131139
*/
132140
public function setEncoding($value)
@@ -138,6 +146,8 @@ public function setEncoding($value)
138146
/**
139147
* Returns the charSet option
140148
*
149+
* @deprecated Since 2.40.0. This method will be removed in 3.0 without replacement
150+
*
141151
* Proxies to {@link getEncoding()}
142152
*
143153
* @return string
@@ -150,9 +160,11 @@ public function getCharSet()
150160
/**
151161
* Sets the charSet option
152162
*
163+
* @deprecated Since 2.40.0. This method will be removed in 3.0. Set options during construction instead
164+
*
153165
* Proxies to {@link setEncoding()}
154166
*
155-
* @param string $charSet
167+
* @param string $charSet
156168
* @return self Provides a fluent interface
157169
*/
158170
public function setCharSet($charSet)
@@ -163,6 +175,8 @@ public function setCharSet($charSet)
163175
/**
164176
* Returns the doubleQuote option
165177
*
178+
* @deprecated Since 2.40.0. This method will be removed in 3.0 without replacement
179+
*
166180
* @return bool
167181
*/
168182
public function getDoubleQuote()
@@ -173,7 +187,9 @@ public function getDoubleQuote()
173187
/**
174188
* Sets the doubleQuote option
175189
*
176-
* @param bool $doubleQuote
190+
* @deprecated Since 2.40.0. This method will be removed in 3.0. Set options during construction instead
191+
*
192+
* @param bool $doubleQuote
177193
* @return self Provides a fluent interface
178194
*/
179195
public function setDoubleQuote($doubleQuote)

0 commit comments

Comments
 (0)