HEX
Server: Apache
System: Linux WWW 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64
User: web11 (1011)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/test.kaunokolegija.lt/kk_wp_content/plugins/marquee-block/includes/Singleton.php
<?php
/**
 * Singleton instance for Classes.
 *
 * @package    StorePress/MarqueeBlock
 * @since      1.1.1
 * @version    1.1.1
 */

declare( strict_types=1 );

namespace StorePress\MarqueeBlock;

defined( 'ABSPATH' ) || die( 'Keep Silent' );

trait Singleton {
	/**
	 * Return singleton instance of Class.
	 * The instance will be created if it does not exist yet.
	 *
	 * @return self The main instance.
	 * @since 1.1.1
	 */
	public static function instance(): self {
		static $instance = null;
		if ( is_null( $instance ) ) {
			$instance = new self();
		}

		return $instance;
	}
}