| 1 | <?php |
||
| 20 | trait Singleton |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * @var static singleton instance |
||
| 24 | */ |
||
| 25 | protected static $instance; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Get instance |
||
| 29 | * |
||
| 30 | * @return static |
||
| 31 | */ |
||
| 32 | 644 | public static function getInstance() |
|
| 36 | |||
| 37 | /** |
||
| 38 | * Initialization of class instance |
||
| 39 | * |
||
| 40 | * @return static |
||
| 41 | */ |
||
| 42 | 632 | private static function initInstance() |
|
| 46 | |||
| 47 | /** |
||
| 48 | * Reset instance |
||
| 49 | * |
||
| 50 | * @return void |
||
| 51 | */ |
||
| 52 | 748 | public static function resetInstance() |
|
| 56 | |||
| 57 | /** |
||
| 58 | * Disabled by access level |
||
| 59 | */ |
||
| 60 | 632 | private function __construct() |
|
| 63 | |||
| 64 | /** |
||
| 65 | * Disabled by access level |
||
| 66 | */ |
||
| 67 | private function __clone() |
||
| 70 | |||
| 71 | /** |
||
| 72 | * Disabled by access level |
||
| 73 | */ |
||
| 74 | private function __wakeup() |
||
| 77 | } |
||
| 78 |