Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate getters and setters in Callback filter #153

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@
</RedundantConditionGivenDocblockType>
</file>
<file src="src/Callback.php">
<DeprecatedMethod>
<code><![CDATA[setCallback]]></code>
<code><![CDATA[setCallbackParams]]></code>
</DeprecatedMethod>
<MixedFunctionCall>
<code><![CDATA[call_user_func_array($this->options['callback'], $params)]]></code>
</MixedFunctionCall>
Expand Down Expand Up @@ -1500,6 +1504,11 @@
</PossiblyUnusedMethod>
</file>
<file src="test/CallbackTest.php">
<DeprecatedMethod>
<code><![CDATA[getCallbackParams]]></code>
<code><![CDATA[getCallbackParams]]></code>
<code><![CDATA[setCallbackParams]]></code>
</DeprecatedMethod>
<InvalidArgument>
<code><![CDATA['param']]></code>
<code><![CDATA['param']]></code>
Expand Down
10 changes: 9 additions & 1 deletion src/Callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ public function __construct($callbackOrOptions = [], $callbackParams = [])
/**
* Sets a new callback for this filter
*
* @deprecated since 2.37.0 - All option setters and getters will be removed in 3.0
*
* @param callable $callback
* @throws Exception\InvalidArgumentException
* @return self
* @throws Exception\InvalidArgumentException
*/
public function setCallback($callback)
{
Expand All @@ -69,6 +71,8 @@ public function setCallback($callback)
/**
* Returns the set callback
*
* @deprecated since 2.37.0 - All option setters and getters will be removed in 3.0
*
* @return callable
*/
public function getCallback()
Expand All @@ -79,6 +83,8 @@ public function getCallback()
/**
* Sets parameters for the callback
*
* @deprecated since 2.37.0 - All option setters and getters will be removed in 3.0
*
* @param array $params
* @return self
*/
Expand All @@ -91,6 +97,8 @@ public function setCallbackParams($params)
/**
* Get parameters for the callback
*
* @deprecated since 2.37.0 - All option setters and getters will be removed in 3.0
*
* @return array
*/
public function getCallbackParams()
Expand Down