-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInvoker_Interface.php
61 lines (54 loc) · 1.41 KB
/
Invoker_Interface.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/**
* Hook_Manager_Interface interface file.
*
* @package eXtended WordPress
* @subpackage Contracts\Hook
*/
namespace XWP\Contracts\Hook;
/**
* Allows handler and hook registration and invocation.
*/
interface Invoker_Interface {
/**
* Get the hook manager instance.
*
* @return static
*/
public static function instance(): static;
/**
* Register multiple handlers with the hook manager.
*
* @param string|object ...$handlers Handlers to register.
* @return static
*/
public function register_handlers( string|object ...$handlers ): static;
/**
* Register a handler with the hook manager.
*
* @param string $handler Handler to register.
* @return static
*/
public function register_handler( string $handler ): static;
/**
* Get handlers registered with the hook manager.
*
* @return array<string, Hookable>
*/
public function get_handlers(): array;
/**
* Get hooks registered with the hook manager.
*
* If a handler classname is provided, only hooks for that handler are returned.
*
* @param string|null $handler Optional. Handler name.
* @return array
*/
public function get_hooks( ?string $handler ): array;
/**
* Get the current context.
*
* @return Context_Interface
*/
public function get_context(): Context_Interface;
}