| 1 |
<?php |
| 2 |
|
| 3 |
namespace FileBird\Utils; |
| 4 |
|
| 5 |
trait Singleton { |
| 6 |
protected static $instance = null; |
| 7 |
|
| 8 |
final public static function getInstance() { |
| 9 |
if ( null === static::$instance ) { |
| 10 |
static::$instance = new static(); |
| 11 |
self::$instance->doHooks(); |
| 12 |
} |
| 13 |
return static::$instance; |
| 14 |
} |
| 15 |
|
| 16 |
public function __construct() { |
| 17 |
|
| 18 |
} |
| 19 |
|
| 20 |
private function doHooks() { |
| 21 |
|
| 22 |
} |
| 23 |
} |
| 24 |
|