-
Notifications
You must be signed in to change notification settings - Fork 1
/
HookableNetworkInterface.php
46 lines (42 loc) · 1.07 KB
/
HookableNetworkInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/*
* This file is part of the phpflo/phpflo package.
*
* (c) Marc Aschmann <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace PhpFlo\Common;
use PhpFlo\Common\Exception\FlowException;
use PhpFlo\Common\Exception\InvalidTypeException;
/**
* Interface HookableNetworkInterface
*
* @package PhpFlo\Common
* @author Marc Aschmann <[email protected]>
*/
interface HookableNetworkInterface
{
/**
* Add a closure to an event
*
* Accepted events are connect, disconnect and data
* Closures will be given the
*
* @param string $event
* @param string $alias
* @param \Closure $closure
* @throws FlowException
* @throws InvalidTypeException
* @return HookableNetworkInterface
*/
public function hook(string $event, string $alias, \Closure $closure);
/**
* Get all defined custom event hooks
*
* @return array
*/
public function hooks(): array;
}