PluginProbe
Float menu – awesome floating side menu / 7.2.5
Float menu – awesome floating side menu v7.2.5
7.2.5 trunk 2.1 2.2 3.0.1 3.1 3.2.2 3.3.1 3.5 3.5.1 3.5.2 3.5.3. 3.5.4 4.0 4.1 4.1.1 4.2 4.3 4.3.1 4.3.2 5.0 5.0.1 5.0.2 5.0.3 5.1 All 57 releases
float-menu / classes / Publish / Singleton.php

Singleton.php in Float menu – awesome floating side menu 7.2.5, at classes/Publish/Singleton.php

41 lines 704 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FloatMenuLite\Publish;
4
5 defined( 'ABSPATH' ) || exit;
6
7 class Singleton {
8 private static $instance;
9 private array $value = [];
10
11 private function __construct() {
12 }
13
14 public static function getInstance() {
15 if ( null === static::$instance ) {
16 static::$instance = new static();
17 }
18
19 return static::$instance;
20 }
21
22 public function setValue( $key, $value ) {
23 $this->value[ $key ] = $value;
24 }
25
26 public function getValue(): array {
27 return $this->value;
28 }
29
30 public function hasKey( $key ): bool {
31 return array_key_exists( $key, $this->value );
32 }
33
34 public function getValueByKey( $key ) {
35 if ( $this->hasKey( $key ) ) {
36 return $this->value[ $key ];
37 }
38
39 return null;
40 }
41 }