PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 3.6.40
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v3.6.40
6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 All 196 releases
fluentform / app / Services / Spout / Common / Singleton.php

Singleton.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 3.6.40, at app/Services/Spout/Common/Singleton.php

42 lines 706 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Box\Spout\Common;
4
5 /**
6 * Class Singleton
7 * Defines a class as a singleton.
8 *
9 * @package Box\Spout\Common
10 */
11 trait Singleton
12 {
13 protected static $instance;
14
15 /**
16 * @return static
17 */
18 final public static function getInstance()
19 {
20 return isset(static::$instance)
21 ? static::$instance
22 : static::$instance = new static;
23 }
24
25 /**
26 * Singleton constructor.
27 */
28 final private function __construct()
29 {
30 $this->init();
31 }
32
33 /**
34 * Initializes the singleton
35 * @return void
36 */
37 protected function init() {}
38
39 final private function __wakeup() {}
40 final private function __clone() {}
41 }
42