PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.3.0
ShopBuilder – WooCommerce Builder For Elementor v2.3.0
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
shopbuilder / app / Traits / SingletonTrait.php

SingletonTrait.php in ShopBuilder – WooCommerce Builder For Elementor 2.3.0, at app/Traits/SingletonTrait.php

55 lines 826 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 *
4 */
5
6 namespace RadiusTheme\SB\Traits;
7
8 // Do not allow directly accessing this file.
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit( 'This script cannot be accessed directly.' );
11 }
12
13 trait SingletonTrait {
14 /**
15 * The single instance of the class.
16 *
17 * @var object
18 */
19 protected static $instance = null;
20
21
22 /**
23 * Constructor
24 *
25 * @return void
26 */
27 // public function __construct() {}
28
29 /**
30 * @return self
31 */
32 final public static function instance() {
33 if ( null === self::$instance ) {
34 self::$instance = new self();
35 }
36
37 return self::$instance;
38 }
39
40
41 /**
42 * Prevent cloning.
43 */
44 final public function __clone() {
45 }
46
47 /**
48 * Prevent unserializing.
49 */
50 final public function __wakeup() {
51 _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'shopbuilder' ), '1.0' );
52 die();
53 }
54 }
55