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

[8.x] Change whereStartsWith, DocBlock to reflect that array is supported #39370

Merged
merged 3 commits into from
Oct 26, 2021
Merged
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
22 changes: 11 additions & 11 deletions src/Illuminate/View/ComponentAttributeBag.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,38 +119,38 @@ public function filter($callback)
/**
* Return a bag of attributes that have keys starting with the given value / pattern.
*
* @param string $string
* @param string|string[] $needles
* @return static
*/
public function whereStartsWith($string)
public function whereStartsWith($needles)
{
return $this->filter(function ($value, $key) use ($string) {
return Str::startsWith($key, $string);
return $this->filter(function ($value, $key) use ($needles) {
return Str::startsWith($key, $needles);
});
}

/**
* Return a bag of attributes with keys that do not start with the given value / pattern.
*
* @param string $string
* @param string|string[] $needles
* @return static
*/
public function whereDoesntStartWith($string)
public function whereDoesntStartWith($needles)
{
return $this->filter(function ($value, $key) use ($string) {
return ! Str::startsWith($key, $string);
return $this->filter(function ($value, $key) use ($needles) {
return ! Str::startsWith($key, $needles);
});
}

/**
* Return a bag of attributes that have keys starting with the given value / pattern.
*
* @param string $string
* @param string|string[] $needles
* @return static
*/
public function thatStartWith($string)
public function thatStartWith($needles)
{
return $this->whereStartsWith($string);
return $this->whereStartsWith($needles);
}

/**
Expand Down