Skip to content

Commit

Permalink
Deprecate Range::setKeyedResponse() in favor of setKeyed() (#1848)
Browse files Browse the repository at this point in the history
* Deprecate Range::setKeyedResponse() in favor of setKeyed()

* Add changelog

* Add @deprecated annotation
  • Loading branch information
deguif authored Oct 28, 2020
1 parent d969746 commit cb72158
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Used new cache endpoints classes [#1840](https://github.com/ruflin/Elastica/pull/1840)
* Used new ingest pipeline endpoints classes [#1834](https://github.com/ruflin/Elastica/pull/1834)
### Deprecated
* Deprecated `Elastica\Aggregation\Range::setKeyedResponse()`, use `setKeyed()` instead [#1848](https://github.com/ruflin/Elastica/pull/1848)
* Deprecated `Elastica\Exception\ResponseException::getElasticsearchException()`, use `getResponse()::getFullError()` instead [#1829](https://github.com/ruflin/Elastica/pull/1829)
* Deprecated `Elastica\QueryBuilder\DSL\Aggregation::global_agg()`, use `global()` instead [#1826](https://github.com/ruflin/Elastica/pull/1826)
* Deprecated Match query class and introduced MatchQuery instead for PHP 8.0 compatibility reason [#1799](https://github.com/ruflin/Elastica/pull/1799)
Expand Down
14 changes: 13 additions & 1 deletion src/Aggregation/Range.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,20 @@ public function addRange($fromValue = null, $toValue = null, ?string $key = null
*
* @return $this
*/
public function setKeyedResponse(bool $keyed = true): self
public function setKeyed(bool $keyed): self
{
return $this->setParam('keyed', $keyed);
}

/**
* @return $this
*
* @deprecated singe version 7.1.0, use the "setKeyed()" method instead.
*/
public function setKeyedResponse(bool $keyed = true): self
{
trigger_deprecation('ruflin/elastica', '7.1.0', 'The "%s()" method is deprecated, use "setKeyed()" instead. It will be removed in 8.0.', __METHOD__);

return $this->setKeyed($keyed);
}
}

0 comments on commit cb72158

Please sign in to comment.