We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a467853 commit e37b94eCopy full SHA for e37b94e
src/Traits/Thrower.php
@@ -26,10 +26,23 @@ public static function throw(...$arguments): void
26
* @param mixed $value
27
* @param mixed ...$arguments
28
*/
29
- public static function throwIf($value, ...$arguments): void
+ public static function throwIf(mixed $value, ...$arguments): void
30
{
31
if ($value) {
32
static::throw(...$arguments);
33
}
34
35
+
36
+ /**
37
+ * @param mixed $value
38
+ * @param mixed ...$arguments
39
+ *
40
+ * @return bool
41
+ */
42
+ public static function throwIfReturn(mixed $value, ...$arguments): bool
43
+ {
44
+ static::throwIf($value, ...$arguments);
45
46
+ return true;
47
+ }
48
0 commit comments