Skip to content

Commit

Permalink
Change the classes in unrelated tests as well
Browse files Browse the repository at this point in the history
  • Loading branch information
shaedrich committed Sep 30, 2024
1 parent bd21862 commit f6b4af4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Database\Query\Builder as QueryBuilder;
use Illuminate\Database\Query\Expression;
use Illuminate\Support\Casing;
use Illuminate\Support\Str;
use InvalidArgumentException;

Expand Down Expand Up @@ -627,7 +628,7 @@ public function withAggregate($relations, $column, $function = null)

unset($alias);

if (count($segments) === 3 && Str::lower($segments[1]) === 'as') {
if (count($segments) === 3 && Casing::lower($segments[1]) === 'as') {
[$name, $alias] = [$segments[0], $segments[2]];
}

Expand Down
7 changes: 4 additions & 3 deletions src/Illuminate/Foundation/Console/DocsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Illuminate\Contracts\Cache\Repository as Cache;
use Illuminate\Http\Client\Factory as Http;
use Illuminate\Support\Arr;
use Illuminate\Support\Casing;
use Illuminate\Support\Collection;
use Illuminate\Support\Env;
use Illuminate\Support\Str;
Expand Down Expand Up @@ -235,15 +236,15 @@ protected function askForPageViaAutocomplete()
label: 'Which page would you like to open?',
options: fn ($value) => $this->pages()
->mapWithKeys(fn ($option) => [
Str::lower($option['title']) => $option['title'],
Casing::lower($option['title']) => $option['title'],
])
->filter(fn ($title) => str_contains(Str::lower($title), Str::lower($value)))
->filter(fn ($title) => str_contains(Casing::lower($title), Casing::lower($value)))
->all(),
placeholder: 'E.g. Collections'
);

return $this->pages()->filter(
fn ($page) => $page['title'] === $choice || Str::lower($page['title']) === $choice
fn ($page) => $page['title'] === $choice || Casing::lower($page['title']) === $choice
)->keys()->first() ?: $this->guessPage($choice);
}

Expand Down
3 changes: 2 additions & 1 deletion src/Illuminate/Foundation/Console/ViewMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Console\Concerns\CreatesMatchingTest;
use Illuminate\Console\GeneratorCommand;
use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Casing;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Str;
use Symfony\Component\Console\Attribute\AsCommand;
Expand Down Expand Up @@ -181,7 +182,7 @@ protected function testClassName()
*/
protected function testClassFullyQualifiedName()
{
$name = Str::of(Str::lower($this->getNameInput()))->replace('.'.$this->option('extension'), '');
$name = Str::of(Casing::lower($this->getNameInput()))->replace('.'.$this->option('extension'), '');

$namespacedName = Str::of(
Str::of($name)
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Support/Stringable.php
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ public function limit($limit = 100, $end = '...', $preserveWords = false)
*/
public function lower()
{
return new static(Str::lower($this->value));
return new static(Casing::lower($this->value));
}

/**
Expand Down
7 changes: 4 additions & 3 deletions src/Illuminate/Validation/Concerns/ValidatesAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Illuminate\Container\Container;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Arr;
use Illuminate\Support\Casing;
use Illuminate\Support\Exceptions\MathException;
use Illuminate\Support\Facades\Date;
use Illuminate\Support\Str;
Expand Down Expand Up @@ -1353,7 +1354,7 @@ public function validateLte($attribute, $value, $parameters)
*/
public function validateLowercase($attribute, $value, $parameters)
{
return Str::lower($value) === $value;
return Casing::lower($value) === $value;
}

/**
Expand All @@ -1366,7 +1367,7 @@ public function validateLowercase($attribute, $value, $parameters)
*/
public function validateUppercase($attribute, $value, $parameters)
{
return Str::upper($value) === $value;
return Casing::upper($value) === $value;
}

/**
Expand Down Expand Up @@ -2290,7 +2291,7 @@ protected function convertValuesToBoolean($values)
protected function convertValuesToNull($values)
{
return array_map(function ($value) {
return Str::lower($value) === 'null' ? null : $value;
return Casing::lower($value) === 'null' ? null : $value;
}, $values);
}

Expand Down

0 comments on commit f6b4af4

Please sign in to comment.