PluginProbe
ElementsKit Elementor Addons – Advanced Widgets & Templates Addons for Elementor / 4.0.3
ElementsKit Elementor Addons – Advanced Widgets & Templates Addons for Elementor v4.0.3
4.0.4 4.0.3 4.0.2 4.0.1 4.0.0 3.10.02 3.10.01 3.9.10 3.9.9 3.9.8 3.9.7 3.9.5 3.9.6 3.9.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.2.0 2.2.1 2.2.2 All 183 releases
elementskit-lite / traits / singleton.php
singleton.php
22 lines 426 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace ElementsKit_Lite\Traits;
4
5 /**
6 * Trait for making singleton instance
7 * This is a factory singleton
8 *
9 * @package ElementsKit_Lite\Traits
10 */
11 trait Singleton {
12 private static $instances = array();
13
14 public static function instance() {
15 $class = get_called_class();
16 if ( ! isset( self::$instances[ $class ] ) ) {
17 self::$instances[ $class ] = new $class();
18 }
19 return self::$instances[ $class ];
20 }
21 }
22