modifs.mineures sans commentaires
This commit is contained in:
parent
1dfda3df07
commit
40aeff8583
@ -7,28 +7,39 @@ use Exception;
|
||||
* Class exceptions: répertoire d'exceptions normalisées
|
||||
*/
|
||||
class exceptions {
|
||||
const WORD = "la valeur#s";
|
||||
|
||||
/**
|
||||
* indiquer qu'une valeur est invalide pour une raison générique
|
||||
*/
|
||||
static function invalid_value($value, ?string $reason=null, string $name="value"): Exception {
|
||||
static function invalid_value($value, ?string $reason=null): Exception {
|
||||
}
|
||||
|
||||
/**
|
||||
* spécialisation de {@link self::invalid_value()} qui permet d'indiquer les
|
||||
* types attendus
|
||||
*/
|
||||
static function invalid_type($value, $expectedTypes=null, string $name="value"): Exception {
|
||||
static function invalid_type($value, $expectedTypes=null): Exception {
|
||||
}
|
||||
|
||||
static function invalid_format($value, ?string $reason=null): Exception {
|
||||
}
|
||||
|
||||
static function out_of_range($value, ?int $min=null, ?int $max=null, ?string $reason=null): Exception {
|
||||
}
|
||||
|
||||
static function null_value(?string $reason=null): Exception {
|
||||
}
|
||||
|
||||
/**
|
||||
* indiquer qu'une valeur est manquante
|
||||
*/
|
||||
static function missing_value(string $name="value"): Exception {
|
||||
static function missing_value(?string $reason=null): Exception {
|
||||
}
|
||||
|
||||
/**
|
||||
* indiquer qu'une valeur est en trop
|
||||
*/
|
||||
static function unexpected_value($value, ?string $reason=null, string $name="value"): Exception {
|
||||
static function unexpected_value($value, ?string $reason=null): Exception {
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user