File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
src/Illuminate/Foundation Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -681,6 +681,38 @@ function report($exception)
681
681
}
682
682
}
683
683
684
+ if (! function_exists ('report_if ' )) {
685
+ /**
686
+ * Report an exception if the given condition is true.
687
+ *
688
+ * @param bool $boolean
689
+ * @param \Throwable|string $exception
690
+ * @return void
691
+ */
692
+ function report_if ($ boolean , $ exception )
693
+ {
694
+ if ($ boolean ) {
695
+ report ($ exception );
696
+ }
697
+ }
698
+ }
699
+
700
+ if (! function_exists ('report_unless ' )) {
701
+ /**
702
+ * Report an exception unless the given condition is true.
703
+ *
704
+ * @param bool $boolean
705
+ * @param \Throwable|string $exception
706
+ * @return void
707
+ */
708
+ function report_unless ($ boolean , $ exception )
709
+ {
710
+ if (! $ boolean ) {
711
+ report ($ exception );
712
+ }
713
+ }
714
+ }
715
+
684
716
if (! function_exists ('request ' )) {
685
717
/**
686
718
* Get an instance of the current request or an input item from the request.
You can’t perform that action at this time.
0 commit comments