Skip to content

Commit

Permalink
Deprecate Reindex::WAIT_FOR_COMPLETION_FALSE
Browse files Browse the repository at this point in the history
  • Loading branch information
franmomu committed Jun 3, 2022
1 parent 5970392 commit 8faadc5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
* Updated `symfony/phpunit-bridge` to `6.0` by @franmomu [#2067](https://github.com/ruflin/Elastica/pull/2067)
### Deprecated
* Deprecated `Elastica\Reindex::WAIT_FOR_COMPLETION_FALSE`, use a boolean as parameter instead by @franmomu [#2070](https://github.com/ruflin/Elastica/pull/2070)
* Passing anything else than a boolean as 1st argument to `Reindex::setWaitForCompletion`, pass a boolean instead by @franmomu [#2070](https://github.com/ruflin/Elastica/pull/2070)
### Removed
* Removed `egeloen/http-adapter` as suggested package since the project is abandoned by @franmomu [#2069](https://github.com/ruflin/Elastica/pull/2069)
* Removed `0` as valid request data using Analyze API by @franmomu [#2068](https://github.com/ruflin/Elastica/pull/2068)
Expand Down
6 changes: 6 additions & 0 deletions src/Reindex.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ class Reindex extends Param
public const REFRESH_FALSE = 'false';
public const REFRESH_WAIT_FOR = 'wait_for';
public const WAIT_FOR_COMPLETION = 'wait_for_completion';

/**
* @deprecated since version 7.2.0, use a boolean as parameter instead.
*/
public const WAIT_FOR_COMPLETION_FALSE = 'false';
public const WAIT_FOR_ACTIVE_SHARDS = 'wait_for_active_shards';
public const TIMEOUT = 'timeout';
Expand Down Expand Up @@ -80,6 +84,8 @@ public function setWaitForCompletion($value): void
{
if (\is_bool($value)) {
$value = $value ? 'true' : 'false';
} else {
\trigger_deprecation('ruflin/elastica', '7.1.6', 'Passing anything else than a boolean as 1st argument to "%s()" is deprecated, pass a boolean instead. It will be removed in 8.0.', __METHOD__);
}

$this->setParam(self::WAIT_FOR_COMPLETION, $value);
Expand Down

0 comments on commit 8faadc5

Please sign in to comment.