# floating-button/6.0.5/classes/Publisher/Singleton.php

Floating Button – Easily Create Sticky, Fixed &amp; Floating Buttons, version 6.0.5. 28 lines.

- Page: https://pluginprobe.com/plugins/floating-button/6.0.5/code/classes/Publisher/Singleton.php
- Raw: https://pluginprobe.com/plugins/floating-button/6.0.5/raw/classes/Publisher/Singleton.php
- Modified: 2024-08-21T11:59:18+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/floating-button/6.0.5/code/classes/Publisher/Singleton.php#L10-L20`.

```php
<?php

namespace FloatingButton\Publisher;

defined( 'ABSPATH' ) || exit;

class Singleton {
	private static $instance;
	private array $value = [];

	private function __construct() {}

	public static function getInstance() {
		if (null === static::$instance) {
			static::$instance = new static();
		}

		return static::$instance;
	}

	public function setValue($key, $value) {
		$this->value[$key] = $value;
	}

	public function getValue(): array {
		return $this->value;
	}
}
```
