Skip to content

Commit

Permalink
✨ Add webhook support
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathieu Ledru committed May 11, 2023
1 parent b446e65 commit e253264
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/Flow/WebhookFlow.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

namespace Flow\Flow;

use Closure;
use Flow\FlowInterface;
use Flow\Ip;

class WebhookFlow extends FlowInterface
{
public function __construct(private FlowInterface $flow)
{
}

public function __invoke(Ip $ip, ?Closure $callback = null): void
{
($this->flow)($ip, $callback);
}

public function fn(FlowInterface $flow): FlowInterface
{
return $this->flow->fn($flow);
}
}

0 comments on commit e253264

Please sign in to comment.