<?php
namespace Wpupgrader\Libraries\WordPress\Plugins\Core;

abstract class Singleton
{
    protected static $instances = [];

    protected function __construct() { }

    protected function __clone() { }

    public static function &getInstance()
    {
        $class = static::class;

        if (!isset(static::$instances[$class])) {
            static::$instances[$class] = new $class();
        }

        return static::$instances[$class];
    }
}