| 1 | <?php |
||
| 11 | trait Singleton |
||
| 12 | { |
||
| 13 | protected static $instance; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @return static |
||
| 17 | */ |
||
| 18 | 209 | final public static function getInstance() |
|
| 24 | |||
| 25 | /** |
||
| 26 | * Singleton constructor. |
||
| 27 | */ |
||
| 28 | 2 | final private function __construct() |
|
| 32 | |||
| 33 | /** |
||
| 34 | * Initializes the singleton |
||
| 35 | * @return void |
||
| 36 | */ |
||
| 37 | protected function init() {} |
||
| 38 | |||
| 39 | final private function __wakeup() {} |
||
| 41 | } |
||
| 42 |