Class IntNumber
Responsibility: Validate raw user input. Parse integer value if possible by Intl
extension or try to determinate floating point automatically ant then parse to int and return int
or NULL
.
-
MvcCore\Ext\Forms\Validator
implements
MvcCore\Ext\Forms\IValidator
-
MvcCore\Ext\Forms\Validators\Number
implements
MvcCore\Ext\Forms\Fields\IMinMaxStepNumbers
uses
MvcCore\Ext\Forms\Field\Props\MinMaxStepNumbers
-
MvcCore\Ext\Forms\Validators\IntNumber
Methods summary
public
integer|null
|
#
Validate( string|array $rawSubmittedValue )
Validate raw user input. Parse integer value if possible by Intl extension
or try to determinate floating point automatically and then parse to int and return int or NULL .
Validate raw user input. Parse integer value if possible by Intl extension
or try to determinate floating point automatically and then parse to int and return int or NULL .
Parameters
- $rawSubmittedValue
- $submitValue Raw user input.
Returns
integer|null Safe submitted value or NULL if not possible to return safe value.
Overrides
|
protected
boolean
|
#
compareFloats( float $a, float $b )
Return TRUE if given floats are absolutelly equal.
Return TRUE if given floats are absolutelly equal.
Parameters
- $a
- (required) Left operand
- $b
- (required) Right operand
Returns
boolean
|
Properties summary
protected static
array
|
$errorMessages
Validation failure message template definitions.
Validation failure message template definitions.
|
#
[
self::ERROR_INT => "Field `{0}` requires a valid integer (from `{1}` to `{2}` incl.).",
]
|