Skip to content

Commit 59e2bcf

Browse files
committed
Forwards compat for Sf 7.3
1 parent 10483de commit 59e2bcf

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

src/StyleManager/Config.php

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*
2020
* @author Daniele Sciannimanica <https://github.com/doishub>
2121
*/
22-
class Config
22+
final class Config
2323
{
2424
/**
2525
* Object instance (Singleton)
@@ -36,6 +36,37 @@ class Config
3636
*/
3737
protected static array $arrArchive = [];
3838

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+
3970
/**
4071
* Return all archives as an array
4172
*/
@@ -139,35 +170,4 @@ protected function loadBundleConfiguration(): array
139170

140171
return [[],[]];
141172
}
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-
}
173173
}

0 commit comments

Comments
 (0)