| 1 |
<?php |
| 2 |
|
| 3 |
namespace FloatingButton\Publisher; |
| 4 |
|
| 5 |
defined( 'ABSPATH' ) || exit; |
| 6 |
|
| 7 |
class Singleton { |
| 8 |
private static $instance; |
| 9 |
private array $value = []; |
| 10 |
|
| 11 |
private function __construct() {} |
| 12 |
|
| 13 |
public static function getInstance() { |
| 14 |
if (null === static::$instance) { |
| 15 |
static::$instance = new static(); |
| 16 |
} |
| 17 |
|
| 18 |
return static::$instance; |
| 19 |
} |
| 20 |
|
| 21 |
public function setValue($key, $value) { |
| 22 |
$this->value[$key] = $value; |
| 23 |
} |
| 24 |
|
| 25 |
public function getValue(): array { |
| 26 |
return $this->value; |
| 27 |
} |
| 28 |
} |