10000 [11.x] Add fluent URL validation class rule by shaedrich · Pull Request #54519 · laravel/framework · GitHub
[go: up one dir, main page]

Skip to content

[11.x] Add fluent URL validation class rule #54519

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

Closed
wants to merge 12 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
StyleCI
  • Loading branch information
shaedrich authored Feb 8, 2025
commit c1c538ae3fe0bf8595d4d71bc5763c3f2152e103
10 changes: 4 additions & 6 deletions src/Illuminate/Validation/Rules/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
use Illuminate\Contracts\Support\Arrayable;
use Stringable;

use function Illuminate\Support\enum_value;

class Url implements Stringable
{
protected bool $active = false;

/**
* @var string[] $protocols
* @var string[]
*/
protected array $protocols = [];

Expand Down Expand Up @@ -40,8 +38,8 @@
public function protocols($protocols = null)
{
$this->protocols = match (true) {
$keys instanceof Arrayable => $keys->toArray(),

Check failure on line 41 in src/Illuminate/Validation/Rules/Url.php

View workflow job for this annotation

GitHub Actions / Source Code

Undefined variable: $keys
!is_array($keys) => func_get_args(),
! is_array($keys) => func_get_args(),
default => $keys,
};

Expand All @@ -50,7 +48,7 @@

public function protocol(string $protocol)
{
$this->protocols = array_unique([ ...$this->protocols, $protocol ]);
$this->protocols = array_unique([...$this->protocols, $protocol]);

return $this;
}
Expand Down
Loading
0