|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
/* |
|
6
|
|
|
* This file is part of the Valkyrja Framework package. |
|
7
|
|
|
* |
|
8
|
|
|
* (c) Melech Mizrachi <[email protected]> |
|
9
|
|
|
* |
|
10
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
11
|
|
|
* file that was distributed with this source code. |
|
12
|
|
|
*/ |
|
13
|
|
|
|
|
14
|
|
|
namespace Valkyrja\Application\Support; |
|
15
|
|
|
|
|
16
|
|
|
use Valkyrja\Config\Config; |
|
17
|
|
|
use Valkyrja\Container\Contract\Service; |
|
18
|
|
|
use Valkyrja\Container\Support\Provider as ContainerProvider; |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* Abstract Class Component. |
|
22
|
|
|
* |
|
23
|
|
|
* @author Melech Mizrachi |
|
24
|
|
|
*/ |
|
25
|
|
|
abstract class Component |
|
26
|
|
|
{ |
|
27
|
|
|
/** |
|
28
|
|
|
* Get the component's config class name. |
|
29
|
|
|
* |
|
30
|
|
|
* @return class-string<Config>|null |
|
|
|
|
|
|
31
|
|
|
*/ |
|
32
|
|
|
public static function getConfig(): string|null |
|
33
|
|
|
{ |
|
34
|
|
|
return null; |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
/** |
|
38
|
|
|
* Get the component's container aliases. |
|
39
|
|
|
* |
|
40
|
|
|
* @return class-string[] |
|
|
|
|
|
|
41
|
|
|
*/ |
|
42
|
|
|
public static function getContainerAliases(): array |
|
43
|
|
|
{ |
|
44
|
|
|
return []; |
|
45
|
|
|
} |
|
46
|
|
|
|
|
47
|
|
|
/** |
|
48
|
|
|
* Get the component's container services. |
|
49
|
|
|
* |
|
50
|
|
|
* @return class-string<Service>[] |
|
|
|
|
|
|
51
|
|
|
*/ |
|
52
|
|
|
public static function getContainerServices(): array |
|
53
|
|
|
{ |
|
54
|
|
|
return []; |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
/** |
|
58
|
|
|
* Get the component's container context aliases. |
|
59
|
|
|
* |
|
60
|
|
|
* @return class-string[] |
|
|
|
|
|
|
61
|
|
|
*/ |
|
62
|
|
|
public static function getContainerContextAliases(): array |
|
63
|
|
|
{ |
|
64
|
|
|
return []; |
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
|
|
/** |
|
68
|
|
|
* Get the component's container context services. |
|
69
|
|
|
* |
|
70
|
|
|
* @return class-string<Service>[] |
|
|
|
|
|
|
71
|
|
|
*/ |
|
72
|
|
|
public static function getContainerContextServices(): array |
|
73
|
|
|
{ |
|
74
|
|
|
return []; |
|
75
|
|
|
} |
|
76
|
|
|
|
|
77
|
|
|
/** |
|
78
|
|
|
* Get the component's container service providers. |
|
79
|
|
|
* |
|
80
|
|
|
* @return class-string<ContainerProvider>[] |
|
|
|
|
|
|
81
|
|
|
*/ |
|
82
|
|
|
public static function getContainerProviders(): array |
|
83
|
|
|
{ |
|
84
|
|
|
return []; |
|
85
|
|
|
} |
|
86
|
|
|
|
|
87
|
|
|
/** |
|
88
|
|
|
* Get the component's event listeners. |
|
89
|
|
|
* |
|
90
|
|
|
* @return class-string[] |
|
|
|
|
|
|
91
|
|
|
*/ |
|
92
|
|
|
public static function getEventListeners(): array |
|
93
|
|
|
{ |
|
94
|
|
|
return []; |
|
95
|
|
|
} |
|
96
|
|
|
|
|
97
|
|
|
/** |
|
98
|
|
|
* Get the component's cli controllers. |
|
99
|
|
|
* |
|
100
|
|
|
* @return class-string[] |
|
|
|
|
|
|
101
|
|
|
*/ |
|
102
|
|
|
public static function getCliControllers(): array |
|
103
|
|
|
{ |
|
104
|
|
|
return []; |
|
105
|
|
|
} |
|
106
|
|
|
|
|
107
|
|
|
/** |
|
108
|
|
|
* Get the component's http controllers. |
|
109
|
|
|
* |
|
110
|
|
|
* @return class-string[] |
|
|
|
|
|
|
111
|
|
|
*/ |
|
112
|
|
|
public static function getHttpControllers(): array |
|
113
|
|
|
{ |
|
114
|
|
|
return []; |
|
115
|
|
|
} |
|
116
|
|
|
|
|
117
|
|
|
/** |
|
118
|
|
|
* Get the component's name. |
|
119
|
|
|
* |
|
120
|
|
|
* @return non-empty-string |
|
|
|
|
|
|
121
|
|
|
*/ |
|
122
|
|
|
abstract public static function getName(): string; |
|
123
|
|
|
} |
|
124
|
|
|
|