Skip to content

Commit 14c01fe

Browse files
committed
fix
1 parent 66541f9 commit 14c01fe

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/ConditionalHandler.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ final class ConditionalHandler
3232
{
3333
private array $params = [];
3434

35-
private bool|Closure $condition = true;
36-
37-
public function __construct(private Closure $handler)
35+
public function __construct(private Closure $handler, private bool|Closure $condition = true)
3836
{
3937
}
4038

@@ -75,8 +73,8 @@ public function __invoke(mixed ...$params)
7573
return $this->resolve(...$params);
7674
}
7775

78-
public static function make(Closure $fn): self
76+
public static function make(Closure $fn, bool|Closure $condition = true): self
7977
{
80-
return new self($fn);
78+
return new self($fn, $condition);
8179
}
8280
}

0 commit comments

Comments
 (0)