forked from SimpleMachines/SMF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathActionInterface.php
55 lines (46 loc) · 1.25 KB
/
ActionInterface.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
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2024 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 3.0 Alpha 2
*/
declare(strict_types=1);
namespace SMF;
/**
* Interface for all action classes.
*
* In general, constructors for classes implementing this interface should
* be protected in order to force instantiation via load(). This is because
* there should normally only ever be one instance of an action.
*/
interface ActionInterface
{
/****************
* Public methods
****************/
/**
* This method should function as the dispatcher to whatever sub-action
* methods are necessary. It is also the place to do any heavy lifting
* needed to finalize setup before dispatching to a sub-action method.
*/
public function execute(): void;
/***********************
* Public static methods
***********************/
/**
* Static wrapper for constructor.
*
* @return static An instance of the class.
*/
public static function load(): static;
/**
* Convenience method to load() and execute() an instance of the class.
*/
public static function call(): void;
}
?>