opensupports/server/libs/SingletonTrait.php

18 lines
296 B
PHP
Raw Normal View History

<?php
trait SingletonTrait
{
private static $instance;
2018-11-19 14:14:27 +01:00
protected function __construct()
{
}
public static function getInstance()
{
if (!isset(static::$instance)) {
static::$instance = new static();
}
return static::$instance;
}
}