retourner la valeur

This commit is contained in:
Jephté Clain 2024-11-15 16:11:58 +04:00
parent 1dca3e8bee
commit 0bbc07311a
1 changed files with 2 additions and 1 deletions

View File

@ -44,8 +44,9 @@ class ValueException extends UserException {
return new static(self::message(null, $message, $kind, $prefix, " should not be null")); return new static(self::message(null, $message, $kind, $prefix, " should not be null"));
} }
static final function check_null($value, ?string $kind=null, ?string $prefix=null, ?string $message=null): void { static final function check_null($value, ?string $kind=null, ?string $prefix=null, ?string $message=null) {
if ($value === null) throw static::null($kind, $prefix, $message); if ($value === null) throw static::null($kind, $prefix, $message);
return $value;
} }
static final function invalid_kind($value=null, ?string $kind=null, ?string $prefix=null, ?string $message=null): self { static final function invalid_kind($value=null, ?string $kind=null, ?string $prefix=null, ?string $message=null): self {