| Total Complexity | 5 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class MultitonInstances |
||
| 15 | { |
||
| 16 | protected static ?MultitonInstances $instance = null; |
||
| 17 | protected Multiton $multi; |
||
| 18 | |||
| 19 | 1 | public static function init(?Interfaces\IStTranslations $lang = null): void |
|
| 22 | } |
||
| 23 | |||
| 24 | 2 | public static function getInstance(?Interfaces\IStTranslations $lang = null): Multiton |
|
| 25 | { |
||
| 26 | 2 | if (empty(static::$instance)) { |
|
| 27 | 2 | static::$instance = new self($lang); |
|
| 28 | } |
||
| 29 | 2 | return static::$instance->multi; |
|
| 30 | } |
||
| 31 | |||
| 32 | 2 | protected function __construct(?Interfaces\IStTranslations $lang = null) |
|
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @codeCoverageIgnore singleton |
||
| 39 | */ |
||
| 40 | private function __clone() |
||
| 45 |