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 passing string to Search::addIndex, hasIndex and addIndices #2103

Closed
wants to merge 0 commits into from

Conversation

franmomu
Copy link
Contributor

Ref: #2100 (comment)

Right now Search::addIndex() and Search::hasIndex() methods allow string|Index as parameter and Search::addIndices() allows an array of Index or string.

This PR creates Search::addIndexByName() and Search::hasIndexByName() which only allows string as parameter and Search::addIndicesByName() which only accepts an array of string.

This PR also deprecates passing string to Search::addIndex(), Search::hasIndex() and Search::addIndices().

src/Search.php Outdated
public function addIndicesByName(array $indices = []): self
{
foreach ($indices as $index) {
$this->addIndexByName($index);
Copy link
Collaborator

@thePanz thePanz Jul 22, 2022

Choose a reason for hiding this comment

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

we should check if $index is really a non-empty string

Copy link
Collaborator

@thePanz thePanz left a comment

Choose a reason for hiding this comment

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

When adding indexesByName we should make sure that each item is a non-empty string

@thePanz
Copy link
Collaborator

thePanz commented Jul 23, 2022

Moved to #2106
Something went wrong with git, sorry @franmomu 😶‍🌫️ 🤦

@franmomu franmomu deleted the deprecate_wrong_types branch July 24, 2022 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants