Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattab <matthieu.aubry@gmail.com>2013-10-11 08:44:52 +0400
committermattab <matthieu.aubry@gmail.com>2013-10-11 08:44:52 +0400
commitb2e72140758928f9a6dd426c064cadf157371955 (patch)
tree196f74fb019e27cf109cda08931c03dc06d7dc5c /core/Singleton.php
parent96df9d579a53515bcc9712bf10f4e1adecf1cbb0 (diff)
Fixing build + update readme
Diffstat (limited to 'core/Singleton.php')
-rw-r--r--core/Singleton.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/core/Singleton.php b/core/Singleton.php
index 73bbd26196..a7abde523d 100644
--- a/core/Singleton.php
+++ b/core/Singleton.php
@@ -11,15 +11,22 @@
namespace Piwik;
+/**
+ * The singleton class restricts the Instantiation of a class to one object only.
+ *
+ * @package Piwik
+ */
class Singleton
{
-
protected static $instances;
protected function __construct() { }
final private function __clone() { }
+ /**
+ * @return self
+ */
public static function getInstance() {
$class = get_called_class();
@@ -29,6 +36,10 @@ class Singleton
return self::$instances[$class];
}
+ /**
+ * Used in tests only
+ * @ignore
+ */
public static function unsetInstance()
{
$class = get_called_class();
@@ -37,6 +48,7 @@ class Singleton
/**
* Sets the singleton instance. For testing purposes.
+ * @ignore
*/
public static function setSingletonInstance($instance)
{