Skip to content

Commit c24261a

Browse files
authored
Boolean condition only for ConditionalProxy(
1 parent d6fef1b commit c24261a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/HasConditionalCalls.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
trait HasConditionalCalls
88
{
99
/**
10-
* @param $condition
10+
* @param mixed $condition
1111
* @param Closure|null $callback
1212
*
1313
* @return static|ConditionalProxy
1414
*/
1515
public function when($condition, ?Closure $callback = null)
1616
{
17+
$condition = (bool)$condition;
1718
if ($callback === null) {
1819
return new ConditionalProxy($this, $condition);
1920
}

0 commit comments

Comments
 (0)