Yaffs site version 1.1
[yaffs-website] / vendor / phpunit / phpunit / tests / _files / Singleton.php
diff --git a/vendor/phpunit/phpunit/tests/_files/Singleton.php b/vendor/phpunit/phpunit/tests/_files/Singleton.php
new file mode 100644 (file)
index 0000000..bfdf3bb
--- /dev/null
@@ -0,0 +1,22 @@
+<?php
+class Singleton
+{
+    private static $uniqueInstance = null;
+
+    protected function __construct()
+    {
+    }
+
+    final private function __clone()
+    {
+    }
+
+    public static function getInstance()
+    {
+        if (self::$uniqueInstance === null) {
+            self::$uniqueInstance = new self;
+        }
+
+        return self::$uniqueInstance;
+    }
+}