Validator
in package
Validator.
Methods for validating ARKs.
Table of Contents
Methods
- followsArkCharacterRepetoire() : bool
- String follows ARK character repetoire.
- followsNaanCharacterRepetoire() : bool
- String follows NAAN character repetoire.
- isValidBaseCompactName() : bool
- Base Compact Name Validator.
- isValidCheckZone() : bool
- Check Zone Validator.
- isValidNaan() : bool
- NAAN Validator.
- shoulderInXdigits() : bool
- Shoulder Validator.
Methods
followsArkCharacterRepetoire()
String follows ARK character repetoire.
public
static followsArkCharacterRepetoire(string $subject[, bool $reservedChars = true ]) : bool
Check if the string contains only characters that are valid for forming ARKs.
Parameters
- $subject : string
-
The input string.
- $reservedChars : bool = true
-
Check conformance, including the reserved character: % - . / (default: true)
Tags
Return values
boolfollowsNaanCharacterRepetoire()
String follows NAAN character repetoire.
public
static followsNaanCharacterRepetoire(string $subject) : bool
Check if the string contains only characters that are valid for forming NAANs.
Parameters
- $subject : string
-
The input string.
Tags
Return values
boolisValidBaseCompactName()
Base Compact Name Validator.
public
static isValidBaseCompactName(string $subject) : bool
Check if string conforms to the pattern of ark:[/]{NAAN}/{Base Name}.
Parameters
- $subject : string
-
The input string.
Return values
boolisValidCheckZone()
Check Zone Validator.
public
static isValidCheckZone(string $subject) : bool
Check if string conforms to the pattern of {NAAN}/{Base Name}.
Parameters
- $subject : string
-
The input string.
Return values
boolisValidNaan()
NAAN Validator.
public
static isValidNaan(string $subject) : bool
Check if given string conforms as valid NAAN.
Parameters
- $subject : string
-
The input string.
Return values
boolshoulderInXdigits()
Shoulder Validator.
public
static shoulderInXdigits(string $shoulder, string $xdigits) : bool
Check if shoulder contains only character which are also in the character repetoire.
Parameters
- $shoulder : string
-
Shoulder
- $xdigits : string
-
character repetoire.