1 | <?php |
||
10 | final class Singleton |
||
11 | { |
||
12 | /** |
||
13 | * @var Singleton |
||
14 | */ |
||
15 | private static $instance; |
||
16 | |||
17 | /** |
||
18 | * Singleton constructor. |
||
19 | */ |
||
20 | 1 | private function __construct() |
|
23 | |||
24 | /** |
||
25 | * Clone magic method |
||
26 | */ |
||
27 | private function __clone() |
||
30 | |||
31 | /** |
||
32 | * Wakeup magic method |
||
33 | */ |
||
34 | private function __wakeup() |
||
37 | |||
38 | /** |
||
39 | * @return Singleton |
||
40 | */ |
||
41 | 1 | public static function getInstance(): Singleton |
|
49 | } |
||
50 |