19
19
*
20
20
* @author Daniele Sciannimanica <https://github.com/doishub>
21
21
*/
22
- class Config
22
+ final class Config
23
23
{
24
24
/**
25
25
* Object instance (Singleton)
@@ -36,6 +36,37 @@ class Config
36
36
*/
37
37
protected static array $ arrArchive = [];
38
38
39
+ /**
40
+ * Prevent direct instantiation (Singleton)
41
+ */
42
+ public function __construct ()
43
+ {
44
+ [$ arrStyleArchives , $ arrStyleGroups ] = static ::loadBundleConfiguration ();
45
+
46
+ self ::$ arrArchive = $ arrStyleArchives ;
47
+ self ::$ arrGroups = $ arrStyleGroups ;
48
+ }
49
+
50
+ /**
51
+ * Prevent cloning of the object (Singleton)
52
+ */
53
+ final public function __clone ()
54
+ {
55
+ }
56
+
57
+ /**
58
+ * Instantiate the config object
59
+ */
60
+ public static function getInstance (): Config |null
61
+ {
62
+ if (static ::$ objInstance === null )
63
+ {
64
+ static ::$ objInstance = new static ();
65
+ }
66
+
67
+ return static ::$ objInstance ;
68
+ }
69
+
39
70
/**
40
71
* Return all archives as an array
41
72
*/
@@ -139,35 +170,4 @@ protected function loadBundleConfiguration(): array
139
170
140
171
return [[],[]];
141
172
}
142
-
143
- /**
144
- * Prevent direct instantiation (Singleton)
145
- */
146
- protected function __construct ()
147
- {
148
- [$ arrStyleArchives , $ arrStyleGroups ] = static ::loadBundleConfiguration ();
149
-
150
- self ::$ arrArchive = $ arrStyleArchives ;
151
- self ::$ arrGroups = $ arrStyleGroups ;
152
- }
153
-
154
- /**
155
- * Prevent cloning of the object (Singleton)
156
- */
157
- final public function __clone ()
158
- {
159
- }
160
-
161
- /**
162
- * Instantiate the config object
163
- */
164
- public static function getInstance (): Config |null
165
- {
166
- if (static ::$ objInstance === null )
167
- {
168
- static ::$ objInstance = new static ();
169
- }
170
-
171
- return static ::$ objInstance ;
172
- }
173
173
}
0 commit comments