FiscalNumberValidator
extends FiscalNumberValidator
in package
Class created by Core/Internal/PluginsDeploy
Table of Contents
Methods
- isValidRFC() : bool
- isValidRNC() : bool
- Validate RNC Rep. Dominicana Accept two format : only number: "000000000" or official format: "000-00000-0"
- isValidSpainCIF() : bool
- isValidSpainDNI() : bool
- normalize() : string
- Normalizes a fiscal number by converting it to uppercase and removing every non-alphanumeric character. If a pattern is provided, the normalized value must match it or the default value is returned.
- validate() : bool
- Check the number depend on type and return true if the number if valid.
Methods
isValidRFC()
public
static isValidRFC(string|null $number) : bool
Parameters
- $number : string|null
Return values
boolisValidRNC()
Validate RNC Rep. Dominicana Accept two format : only number: "000000000" or official format: "000-00000-0"
public
static isValidRNC(string|null $number) : bool
Parameters
- $number : string|null
Return values
boolisValidSpainCIF()
public
static isValidSpainCIF(string|null $cif) : bool
Parameters
- $cif : string|null
Return values
boolisValidSpainDNI()
public
static isValidSpainDNI(string|null $dni) : bool
Parameters
- $dni : string|null
Return values
boolnormalize()
Normalizes a fiscal number by converting it to uppercase and removing every non-alphanumeric character. If a pattern is provided, the normalized value must match it or the default value is returned.
public
static normalize(string|null $number[, string $pattern = '' ][, string $default = '' ]) : string
Parameters
- $number : string|null
- $pattern : string = ''
- $default : string = ''
Return values
stringvalidate()
Check the number depend on type and return true if the number if valid.
public
static validate(string|null $type, string|null $number[, bool $force = false ]) : bool
Parameters
- $type : string|null
- $number : string|null
- $force : bool = false