Move Domain_Controller::NUMBER_MAX to Address::ADDRESS_FIELD_MAX

This commit is contained in:
2024-04-12 15:29:11 +10:00
parent 77df5746be
commit 1e08c2f6f7
8 changed files with 24 additions and 27 deletions

View File

@@ -4,13 +4,13 @@ namespace App\Rules;
use Illuminate\Contracts\Validation\Rule;
use App\Http\Controllers\DomainController;
use App\Models\Address;
class FidoInteger implements Rule
{
/**
* Determine if the validation rule passes.
* This will check that a number used for zone, net, host is between 1 and DomainController::NUMBER_MAX.
* This will check that a number used for zone, net, host is between 1 and Address::ADDRESS_FIELD_MAX.
*
* @param string $attribute
* @param mixed $value
@@ -18,7 +18,7 @@ class FidoInteger implements Rule
*/
public function passes($attribute,$value)
{
return (is_numeric($value) && ($value >= 0) && ($value < DomainController::NUMBER_MAX));
return (is_numeric($value) && ($value >= 0) && ($value < Address::ADDRESS_FIELD_MAX));
}
/**
@@ -28,6 +28,6 @@ class FidoInteger implements Rule
*/
public function message()
{
return sprintf('The number must be between 0 and %d.',DomainController::NUMBER_MAX);
return sprintf('The number must be between 0 and %d.',Address::ADDRESS_FIELD_MAX);
}
}