You've already forked php-flasher
mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-04-05 12:32:55 +01:00
call when method multiple times
This commit is contained in:
@@ -270,6 +270,11 @@ class NotificationBuilder implements NotificationBuilderInterface
|
||||
*/
|
||||
public function when($condition)
|
||||
{
|
||||
$stamp = $this->envelope->get('Flasher\Prime\Stamp\WhenStamp');
|
||||
if ($stamp instanceof WhenStamp) {
|
||||
$condition = $stamp->getCondition() && $condition;
|
||||
}
|
||||
|
||||
$this->envelope->withStamp(new WhenStamp($condition));
|
||||
|
||||
return $this;
|
||||
|
||||
Reference in New Issue
Block a user