<?php

namespace GOS\GravityOps\Core\Traits;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

trait SingletonTrait {

	/**
	 * Holds the singleton instance of the class.
	 *
	 * @var self|null
	 */
	private static $instance = null;

	/**
	 * Returns the singleton instance of this class.
	 *
	 * @return self
	 */
	public static function get_instance() {
		if ( is_null( self::$instance ) ) {
			self::$instance = new self();
		}

		return self::$instance;
	}
}
