Skip to content

Commit

Permalink
Merge 2ec4657 into 788711f
Browse files Browse the repository at this point in the history
  • Loading branch information
deguif committed Oct 26, 2020
2 parents 788711f + 2ec4657 commit b867a53
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Supported PHP 8.0 [#1794](https://github.com/ruflin/Elastica/pull/1794)
* Added support for defining a connection pool with DSN. Example: `pool(http://127.0.0.1 http://127.0.0.2/bar?timeout=4)` [#1808](https://github.com/ruflin/Elastica/pull/1808)
* Added `Elastica\Aggregation\Composite` aggregation [#1804](https://github.com/ruflin/Elastica/pull/1804)
* Added `symfony/deprecation-contracts` package to handle deprecations [#1823](https://github.com/ruflin/Elastica/pull/1823)
### Changed
* Allow `string` such as `wait_for` to be passed to `AbstractUpdateAction::setRefresh` [#1791](https://github.com/ruflin/Elastica/pull/1791)
* Changed the return type of `AbstractUpdateAction::getRefresh` to `boolean|string` [#1791](https://github.com/ruflin/Elastica/pull/1791)
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"ext-json": "*",
"psr/log": "^1.0",
"elasticsearch/elasticsearch": "^7.1.1 !=7.4.0",
"nyholm/dsn": "^2.0.0"
"nyholm/dsn": "^2.0.0",
"symfony/deprecation-contracts": "^2.2"
},
"require-dev": {
"aws/aws-sdk-php": "^3.155",
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/ElasticsearchException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Elastica\Exception;

\trigger_error('Elastica\Exception\ElasticsearchException is deprecated. Use Elastica\Exception\ResponseException::getResponse::getFullError instead.', E_USER_DEPRECATED);
trigger_deprecation('ruflin/elastica', '5.2.0', 'The "%s" class is deprecated, use "Elastica\Exception\ResponseException::getResponse()::getFullError()" instead. It will be removed in 8.0.', ElasticsearchException::class);

/**
* Elasticsearch exception.
Expand Down
4 changes: 2 additions & 2 deletions src/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,11 +383,11 @@ public function create(array $args = [], $options = null): Response
{
if (null === $options) {
if (\func_num_args() >= 2) {
@\trigger_error(\sprintf('Passing null as 2nd argument to "%s()" is deprecated since Elastica 7.0.1, avoid passing this argument or pass an array instead.', __METHOD__), \E_USER_DEPRECATED);
trigger_deprecation('ruflin/elastica', '7.1.0', 'Passing null as 2nd argument to "%s()" is deprecated, avoid passing this argument or pass an array instead. It will be removed in 8.0.', __METHOD__);
}
$options = [];
} elseif (\is_bool($options)) {
@\trigger_error(\sprintf('Passing a bool as 2nd argument to "%s()" is deprecated since Elastica 7.0.1, pass an array with the key "recreate" instead.', __METHOD__), \E_USER_DEPRECATED);
trigger_deprecation('ruflin/elastica', '7.1.0', 'Passing a bool as 2nd argument to "%s()" is deprecated, pass an array with the key "recreate" instead. It will be removed in 8.0.', __METHOD__);
$options = ['recreate' => $options];
} elseif (!\is_array($options)) {
throw new \TypeError(\sprintf('Argument 2 passed to "%s()" must be of type array|bool|null, %s given.', __METHOD__, \is_object($options) ? \get_class($options) : \gettype($options)));
Expand Down
2 changes: 1 addition & 1 deletion src/Query/Match.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Elastica\Query;

\trigger_error('Elastica\Query\Match is deprecated. Use Elastica\Query\MatchQuery instead. From PHP 8 match is reserved word and this class will be removed in further Elastica releases', \E_USER_DEPRECATED);
trigger_deprecation('ruflin/elastica', '7.1.0', 'The "%s" class is deprecated, use "%s" instead. "match" is a reserved keyword starting from PHP 8.0. It will be removed in 8.0.', Match::class, MatchQuery::class);

/**
* Match query.
Expand Down
2 changes: 1 addition & 1 deletion src/QueryBuilder/DSL/Aggregation.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public function global(string $name): GlobalAggregation
*/
public function global_agg(string $name): GlobalAggregation
{
@\trigger_error(\sprintf('The "%s()" method is deprecated since Elastica 7.0.1, use global() instead.', __METHOD__), E_USER_DEPRECATED);
trigger_deprecation('ruflin/elastica', '7.1.0', 'The "%s()" method is deprecated, use global() instead. It will be removed in 8.0.', __METHOD__);

return $this->global($name);
}
Expand Down

0 comments on commit b867a53

Please sign in to comment.