|
1
|
|
|
<?php |
|
2
|
|
|
declare(strict_types=1); |
|
3
|
|
|
/** |
|
4
|
|
|
* Minotaur |
|
5
|
|
|
* |
|
6
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
|
7
|
|
|
* use this file except in compliance with the License. You may obtain a copy of |
|
8
|
|
|
* the License at |
|
9
|
|
|
* |
|
10
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
|
11
|
|
|
* |
|
12
|
|
|
* Unless required by applicable law or agreed to in writing, software |
|
13
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
|
14
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
|
15
|
|
|
* License for the specific language governing permissions and limitations under |
|
16
|
|
|
* the License. |
|
17
|
|
|
* |
|
18
|
|
|
* @copyright 2015-2017 Appertly |
|
19
|
|
|
* @license Apache-2.0 |
|
20
|
|
|
*/ |
|
21
|
|
|
namespace Minotaur; |
|
22
|
|
|
|
|
23
|
|
|
/** |
|
24
|
|
|
* Interface for system module. |
|
25
|
|
|
*/ |
|
26
|
|
|
abstract class Module |
|
27
|
|
|
{ |
|
28
|
|
|
/** |
|
29
|
|
|
* Gets the module metadata. |
|
30
|
|
|
* |
|
31
|
|
|
* This array should contain at the very least the keys `name`, `version`, |
|
32
|
|
|
* `author`, and `description`. Feel free to add any additional fields you |
|
33
|
|
|
* like, such as `license`, or `copyright`. |
|
34
|
|
|
* |
|
35
|
|
|
* @return array<string,string> A Map of the module metadata |
|
36
|
|
|
*/ |
|
37
|
|
|
abstract public function getMeta(): array; |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* Gets static configuration settings. |
|
41
|
|
|
* |
|
42
|
|
|
* @return array<string,mixed> The module configuration settings |
|
43
|
|
|
*/ |
|
44
|
|
|
public function getConfig(): array |
|
45
|
|
|
{ |
|
46
|
|
|
return []; |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
/** |
|
50
|
|
|
* Allows the module to register classes in the backend container. |
|
51
|
|
|
* |
|
52
|
|
|
* This method must only invoke the `eager`, `lazy`, and `proto` methods. It |
|
53
|
|
|
* should *not* attempt to build the container. |
|
54
|
|
|
* |
|
55
|
|
|
* @param $builder - The backend dependency injection container |
|
56
|
|
|
* @param $properties - The configuration settings |
|
57
|
|
|
*/ |
|
58
|
|
|
public function setupBackend(\Caridea\Container\Builder $builder, \Caridea\Container\Properties $properties): void |
|
|
|
|
|
|
59
|
|
|
{ |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
/** |
|
63
|
|
|
* Allows the module to register classes in the frontend container. |
|
64
|
|
|
* |
|
65
|
|
|
* This method must only invoke the `eager`, `lazy`, and `proto` methods. It |
|
66
|
|
|
* should *not* attempt to build the container. |
|
67
|
|
|
* |
|
68
|
|
|
* @param $builder - The frontend dependency injection container |
|
69
|
|
|
* @param $properties - The configuration settings |
|
70
|
|
|
*/ |
|
71
|
|
|
public function setupFrontend(\Caridea\Container\Builder $builder, \Caridea\Container\Properties $properties): void |
|
|
|
|
|
|
72
|
|
|
{ |
|
73
|
|
|
} |
|
74
|
|
|
} |
|
75
|
|
|
|
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.