game/_incl_data/class/DarksLight2/Traits/Singleton.php

17 lines
291 B
PHP

<?php
namespace DarksLight2\Traits;
trait Singleton
{
private static self $instance;
public static function getInstance(...$args): self
{
if(!isset(self::$instance)) {
self::$instance = new self(...$args);
}
return self::$instance;
}
}