Status
in package
Statut de vérification de conformité d'une instance à un schéma
Un objet de cette classe est retourné par une vérification et contiendra les erreurs et alertes fournies.
Les erreurs sont structurées dans un arbre correspondant aux oneOf rencontrés lors de la vérification. Chaque noeud de l'arbre contient une liste de chaines et de sous-arbre, chacun indexé par une chaine. Exemple: http://localhost/schema/?schema=geojson%2Fgeometry.schema.yaml&instance=type%3A+LineString%0D%0Acoordinates%3A+%5B1%2C+2%5D&action=fchoice
Table of Contents
Properties
Methods
- __construct() : mixed
- __toString() : string
- append() : Status
- ajoute à la fin du statut courant le statut en paramètre et renvoie le statut courant
- errors() : array<int, string|array<string, mixed>>
- retourne les erreurs
- ok() : bool
- retourne true ssi pas d'erreur
- setError() : self
- ajoute une erreur, retourne $this
- setErrorBranch() : self
- ajoute une branche d'erreurs, retourne $this
- setWarning() : void
- ajoute un warning
- showErrors() : void
- affiche les erreurs
- showWarnings() : void
- affiche les warnings
- warnings() : array<int, string>
- retourne les alertes
Properties
$errors
private
array<int, string|array<string, mixed>>
$errors
$warnings
private
array<int, string>
$warnings
Methods
__construct()
public
__construct([array<int, string|array<string, mixed>> $errors = [] ][, array<int, string> $warnings = [] ]) : mixed
Parameters
- $errors : array<int, string|array<string, mixed>> = []
- $warnings : array<int, string> = []
__toString()
public
__toString() : string
Return values
stringappend()
ajoute à la fin du statut courant le statut en paramètre et renvoie le statut courant
public
append(Status $toAppend) : Status
Parameters
- $toAppend : Status
Return values
Statuserrors()
retourne les erreurs
public
errors() : array<int, string|array<string, mixed>>
Return values
array<int, string|array<string, mixed>>ok()
retourne true ssi pas d'erreur
public
ok() : bool
Return values
boolsetError()
ajoute une erreur, retourne $this
public
setError(string $message) : self
Parameters
- $message : string
Return values
selfsetErrorBranch()
ajoute une branche d'erreurs, retourne $this
public
setErrorBranch(string $message, array<int, mixed> $statusArray) : self
Parameters
- $message : string
- $statusArray : array<int, mixed>
Return values
selfsetWarning()
ajoute un warning
public
setWarning(string $message) : void
Parameters
- $message : string
showErrors()
affiche les erreurs
public
showErrors([string $message = '' ]) : void
Parameters
- $message : string = ''
showWarnings()
affiche les warnings
public
showWarnings([string $message = '' ]) : void
Parameters
- $message : string = ''
warnings()
retourne les alertes
public
warnings() : array<int, string>