1
|
|
|
<?php |
2
|
|
|
declare(strict_types=1); |
3
|
|
|
/** |
4
|
|
|
* Caridea Module |
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
|
|
|
* @copyright 2017-2018 LibreWorks contributors |
20
|
|
|
* @license Apache-2.0 |
21
|
|
|
*/ |
22
|
|
|
namespace Caridea\Module; |
23
|
|
|
|
24
|
|
|
use Caridea\Container\Builder; |
25
|
|
|
use Caridea\Container\Properties; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* A module definition. |
29
|
|
|
*/ |
30
|
|
|
abstract class Module |
31
|
|
|
{ |
32
|
|
|
/** |
33
|
|
|
* Gets the module metadata. |
34
|
|
|
* |
35
|
|
|
* This array should contain at the very least the keys `name`, `version`, |
36
|
|
|
* and `description`. Feel free to add any additional fields you like, such |
37
|
|
|
* as `author`, `license`, or `copyright`. |
38
|
|
|
* |
39
|
|
|
* @return array<string,string> An associative array of the module metadata |
40
|
|
|
*/ |
41
|
1 |
|
public function getMeta(): array |
42
|
|
|
{ |
43
|
1 |
|
return []; |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* Gets static configuration settings. |
48
|
|
|
* |
49
|
|
|
* @return array<string,mixed> The module configuration settings |
50
|
|
|
*/ |
51
|
2 |
|
public function getConfig(): array |
52
|
|
|
{ |
53
|
2 |
|
return []; |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* Allows the module to register classes in the backend container. |
58
|
|
|
* |
59
|
|
|
* This method must only invoke the `eager`, `lazy`, and `proto` methods. It |
60
|
|
|
* should *not* attempt to build the container. |
61
|
|
|
* |
62
|
|
|
* @param \Caridea\Container\Builder $builder The backend dependency injection container builder |
63
|
|
|
* @param \Caridea\Container\Properties $properties The configuration settings |
64
|
|
|
* @return void |
65
|
|
|
*/ |
66
|
1 |
|
public function setupBackend(Builder $builder, Properties $properties) |
|
|
|
|
67
|
|
|
{ |
68
|
1 |
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* Allows the module to register classes in the frontend container. |
72
|
|
|
* |
73
|
|
|
* This method must only invoke the `eager`, `lazy`, and `proto` methods. It |
74
|
|
|
* should *not* attempt to build the container. |
75
|
|
|
* |
76
|
|
|
* @param \Caridea\Container\Builder $builder The frontend dependency injection container builder |
77
|
|
|
* @param \Caridea\Container\Properties $properties The configuration settings |
78
|
|
|
* @return void |
79
|
|
|
*/ |
80
|
1 |
|
public function setupFrontend(Builder $builder, Properties $properties) |
|
|
|
|
81
|
|
|
{ |
82
|
1 |
|
} |
83
|
|
|
} |
84
|
|
|
|
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.