diff options
author | mattab <matthieu.aubry@gmail.com> | 2013-10-11 08:44:52 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2013-10-11 08:44:52 +0400 |
commit | b2e72140758928f9a6dd426c064cadf157371955 (patch) | |
tree | 196f74fb019e27cf109cda08931c03dc06d7dc5c /core/Singleton.php | |
parent | 96df9d579a53515bcc9712bf10f4e1adecf1cbb0 (diff) |
Fixing build + update readme
Diffstat (limited to 'core/Singleton.php')
-rw-r--r-- | core/Singleton.php | 14 |
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) { |