Skip to content

Commit

Permalink
Merge pull request #218 from gsteel/v2/htmlentities-deprecations
Browse files Browse the repository at this point in the history
Deprecate getters and setters in the `HtmlEntities` filter
  • Loading branch information
gsteel authored Jan 6, 2025
2 parents f9e9083 + 08aad80 commit 9b32ba7
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 5 deletions.
35 changes: 34 additions & 1 deletion psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1249,6 +1249,20 @@
<DeprecatedClass>
<code><![CDATA[AbstractFilter]]></code>
</DeprecatedClass>
<DeprecatedMethod>
<code><![CDATA[getDoubleQuote]]></code>
<code><![CDATA[getDoubleQuote]]></code>
<code><![CDATA[getEncoding]]></code>
<code><![CDATA[getEncoding]]></code>
<code><![CDATA[getEncoding]]></code>
<code><![CDATA[getEncoding]]></code>
<code><![CDATA[getQuoteStyle]]></code>
<code><![CDATA[getQuoteStyle]]></code>
<code><![CDATA[setDoubleQuote]]></code>
<code><![CDATA[setEncoding]]></code>
<code><![CDATA[setEncoding]]></code>
<code><![CDATA[setQuoteStyle]]></code>
</DeprecatedMethod>
<DocblockTypeContradiction>
<code><![CDATA[is_array($options)]]></code>
</DocblockTypeContradiction>
Expand Down Expand Up @@ -2061,8 +2075,8 @@
</InvalidArgument>
<PossiblyUnusedMethod>
<code><![CDATA[returnInvalidFilterInputProvider]]></code>
<code><![CDATA[returnValidFilterInputProvider]]></code>
<code><![CDATA[returnUnfilteredDataProvider]]></code>
<code><![CDATA[returnValidFilterInputProvider]]></code>
</PossiblyUnusedMethod>
</file>
<file src="test/File/RenameUploadTest.php">
Expand Down Expand Up @@ -2134,6 +2148,25 @@
</PossiblyUnusedMethod>
</file>
<file src="test/HtmlEntitiesTest.php">
<DeprecatedMethod>
<code><![CDATA[getCharSet]]></code>
<code><![CDATA[getCharSet]]></code>
<code><![CDATA[getDoubleQuote]]></code>
<code><![CDATA[getDoubleQuote]]></code>
<code><![CDATA[getEncoding]]></code>
<code><![CDATA[getQuoteStyle]]></code>
<code><![CDATA[getQuoteStyle]]></code>
<code><![CDATA[getQuoteStyle]]></code>
<code><![CDATA[setCharSet]]></code>
<code><![CDATA[setCharSet]]></code>
<code><![CDATA[setDoubleQuote]]></code>
<code><![CDATA[setDoubleQuote]]></code>
<code><![CDATA[setQuoteStyle]]></code>
<code><![CDATA[setQuoteStyle]]></code>
<code><![CDATA[setQuoteStyle]]></code>
<code><![CDATA[setQuoteStyle]]></code>
<code><![CDATA[setQuoteStyle]]></code>
</DeprecatedMethod>
<PossiblyUnusedMethod>
<code><![CDATA[returnUnfilteredDataProvider]]></code>
</PossiblyUnusedMethod>
Expand Down
24 changes: 20 additions & 4 deletions src/HtmlEntities.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ public function __construct($options = [])
/**
* Returns the quoteStyle option
*
* @deprecated Since 2.40.0. This method will be removed in 3.0 without replacement
*
* @return int
*/
public function getQuoteStyle()
Expand All @@ -104,7 +106,9 @@ public function getQuoteStyle()
/**
* Sets the quoteStyle option
*
* @param int $quoteStyle
* @deprecated Since 2.40.0. This method will be removed in 3.0. Set options during construction instead
*
* @param int $quoteStyle
* @return self Provides a fluent interface
*/
public function setQuoteStyle($quoteStyle)
Expand All @@ -116,6 +120,8 @@ public function setQuoteStyle($quoteStyle)
/**
* Get encoding
*
* @deprecated Since 2.40.0. This method will be removed in 3.0 without replacement
*
* @return string
*/
public function getEncoding()
Expand All @@ -126,7 +132,9 @@ public function getEncoding()
/**
* Set encoding
*
* @param string $value
* @deprecated Since 2.40.0. This method will be removed in 3.0. Set options during construction instead
*
* @param string $value
* @return self
*/
public function setEncoding($value)
Expand All @@ -138,6 +146,8 @@ public function setEncoding($value)
/**
* Returns the charSet option
*
* @deprecated Since 2.40.0. This method will be removed in 3.0 without replacement
*
* Proxies to {@link getEncoding()}
*
* @return string
Expand All @@ -150,9 +160,11 @@ public function getCharSet()
/**
* Sets the charSet option
*
* @deprecated Since 2.40.0. This method will be removed in 3.0. Set options during construction instead
*
* Proxies to {@link setEncoding()}
*
* @param string $charSet
* @param string $charSet
* @return self Provides a fluent interface
*/
public function setCharSet($charSet)
Expand All @@ -163,6 +175,8 @@ public function setCharSet($charSet)
/**
* Returns the doubleQuote option
*
* @deprecated Since 2.40.0. This method will be removed in 3.0 without replacement
*
* @return bool
*/
public function getDoubleQuote()
Expand All @@ -173,7 +187,9 @@ public function getDoubleQuote()
/**
* Sets the doubleQuote option
*
* @param bool $doubleQuote
* @deprecated Since 2.40.0. This method will be removed in 3.0. Set options during construction instead
*
* @param bool $doubleQuote
* @return self Provides a fluent interface
*/
public function setDoubleQuote($doubleQuote)
Expand Down

0 comments on commit 9b32ba7

Please sign in to comment.