PluginProbe
UpStream: a Project Management Plugin for WordPress / trunk
UpStream: a Project Management Plugin for WordPress vtrunk
trunk 1.39.0 1.39.1 1.39.2 1.39.3 2.0.7 2.1.0
upstream / includes / libraries / cmb2-grid / DesignPatterns / Singleton.php

Singleton.php in UpStream: a Project Management Plugin for WordPress trunk, at includes/libraries/cmb2-grid/DesignPatterns/Singleton.php

37 lines 839 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Cmb2Grid\DesignPatterns;
4
5 /**
6 * Description of Singleton.
7 *
8 * Pablo Pacheco <pablo.pacheco@origgami.com.br>
9 */
10 if ( ! class_exists('\Cmb2Grid\DesignPatterns\Singleton')) {
11 abstract class Singleton
12 {
13 abstract protected function __construct();
14
15 /**
16 * Returns the *Singleton* instance of this class.
17 *
18 * @staticvar Singleton $instance The *Singleton* instances of this class.
19 *
20 * @return Current_Class_Name
21 */
22 public static function getInstance()
23 {
24 static $instance = null;
25 if (null === $instance) {
26 $instance = new static();
27 }
28
29 return $instance;
30 }
31
32 final private function __clone()
33 {
34 }
35 }
36 }
37