mirror of
https://github.com/pterodactyl/panel.git
synced 2026-12-02 04:15:52 -05:00
21 lines
584 B
PHP
21 lines
584 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Pterodactyl\Rules;
|
|
|
|
use Closure;
|
|
use Illuminate\Contracts\Validation\ValidationRule;
|
|
use Pterodactyl\Services\Extensions\ExtensionSettingValueGuard;
|
|
|
|
/** An extension field's value: a string, number, boolean or null, or a list of those. */
|
|
final class ExtensionFieldValue implements ValidationRule
|
|
{
|
|
public function validate(string $attribute, mixed $value, Closure $fail): void
|
|
{
|
|
if (! ExtensionSettingValueGuard::isFieldValue($value)) {
|
|
$fail(__('validation.internal.extension_field_value'));
|
|
}
|
|
}
|
|
}
|