mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-05 07:52:34 +00:00
Add phpstan level 7(#544)
This commit is contained in:
@ -7,12 +7,7 @@
|
||||
|
||||
class CronRule implements ValidationRule
|
||||
{
|
||||
private bool $acceptCustom;
|
||||
|
||||
public function __construct(bool $acceptCustom = false)
|
||||
{
|
||||
$this->acceptCustom = $acceptCustom;
|
||||
}
|
||||
public function __construct(private readonly bool $acceptCustom = false) {}
|
||||
|
||||
public function validate(string $attribute, mixed $value, \Closure $fail): void
|
||||
{
|
||||
|
@ -12,7 +12,7 @@ public function validate(string $attribute, mixed $value, Closure $fail): void
|
||||
if (! $value) {
|
||||
return;
|
||||
}
|
||||
if (preg_match("/^(?!\-)(?:[a-zA-Z\d\-]{0,62}[a-zA-Z\d]\.){1,126}(?!\d+)[a-zA-Z\d]{1,63}$/", $value) === 1) {
|
||||
if (preg_match("/^(?!\-)(?:[a-zA-Z\d\-]{0,62}[a-zA-Z\d]\.){1,126}(?!\d+)[a-zA-Z\d]{1,63}$/", (string) $value) === 1) {
|
||||
return;
|
||||
}
|
||||
$fail('Domain is not valid')->translate();
|
||||
|
Reference in New Issue
Block a user