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

Fix type-hint for Search::setOptionsAndQuery() #2009

Merged
merged 2 commits into from
Oct 29, 2021
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Deprecated
### Removed
### Fixed
* Fixed type-hint for `Elastica\Search::setOptionsAndQuery()` [#2009](https://github.com/ruflin/Elastica/pull/2009)
### Security

## [7.1.2](https://github.com/ruflin/Elastica/compare/7.1.1...7.1.2)
Expand Down
13 changes: 6 additions & 7 deletions src/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Elastica;

use Elastica\Exception\InvalidException;
use Elastica\Query\AbstractQuery;
use Elastica\ResultSet\BuilderInterface;
use Elastica\ResultSet\DefaultBuilder;

Expand Down Expand Up @@ -254,8 +253,8 @@ public function getPath(): string
/**
* Search in the set indices.
*
* @param AbstractQuery|array|Query|string $query
* @param array|int $options Limit or associative array of options (option=>value)
* @param array|Query|Query\AbstractQuery|string $query
* @param array|int $options Limit or associative array of options (option=>value)
*
* @throws InvalidException
*/
Expand All @@ -282,8 +281,8 @@ public function search($query = '', $options = null, string $method = Request::P
}

/**
* @param AbstractQuery|array|Query|string $query
* @param bool $fullResult By default only the total hit count is returned. If set to true, the full ResultSet including aggregations is returned
* @param array|Query|Query\AbstractQuery|string $query
* @param bool $fullResult By default only the total hit count is returned. If set to true, the full ResultSet including aggregations is returned
*
* @return int|ResultSet
*/
Expand All @@ -310,8 +309,8 @@ public function count($query = '', bool $fullResult = false, string $method = Re
}

/**
* @param array|int $options
* @param AbstractQuery|array|Query|string $query
* @param array|int $options
* @param array|Query|Query\AbstractQuery|string|Suggest $query
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the real type-hint change

*/
public function setOptionsAndQuery($options = null, $query = ''): self
{
Expand Down