HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //proc/thread-self/cwd/wp-content/plugins/essential-blocks/includes/Traits/HasSingletone.php
<?php

namespace EssentialBlocks\Traits;

trait HasSingletone {
	/**
	 * Holds the plugin instance.
	 *
	 * @since 2.0.0
	 * @access private
	 * @static
	 *
	 * @var static
	 */
	protected static $instances = array();
	/**
	 * Sets up a single instance of the plugin.
	 *
	 * @since 2.0.0
	 * @access public
	 * @var mixed $args
	 *
	 * @static
	 *
	 * @return static An instance of the class.
	 */
	public static function get_instance( ...$args ) {
		if ( ! isset( self::$instances[ static::class ] ) ) {
			self::$instances[ static::class ] = ! empty( $args ) ? new static( ...$args ) : new static();
		}

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

	protected function __construct( ...$args ) {}
}