From 0bbc07311a28496a720addb288e0198164d9d5b0 Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Fri, 15 Nov 2024 16:11:58 +0400 Subject: [PATCH] retourner la valeur --- src/ValueException.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ValueException.php b/src/ValueException.php index 5f0ec3a..2c72f4f 100644 --- a/src/ValueException.php +++ b/src/ValueException.php @@ -44,8 +44,9 @@ class ValueException extends UserException { 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); + return $value; } static final function invalid_kind($value=null, ?string $kind=null, ?string $prefix=null, ?string $message=null): self {