<?php

/**
 * Created by PhpStorm.
 * User: guanxl
 * Date: 2018/3/22
 * Time: 19:57
 */
namespace App\Traits;


trait Singleton
{
    private static $instance;

    static function getInstance(...$args)
    {
        if(!isset(self::$instance)){
            self::$instance = new static(...$args);
        }
        return self::$instance;
    }
}