class Singleton

Hierarchy

Expanded class hierarchy of Singleton

File

drupal/core/vendor/phpunit/phpunit/Tests/_files/Singleton.php, line 2

View source
class Singleton {
  private static $uniqueInstance = NULL;
  protected function __construct() {
  }
  private final function __clone() {
  }
  public static function getInstance() {
    if (self::$uniqueInstance === NULL) {
      self::$uniqueInstance = new Singleton();
    }
    return self::$uniqueInstance;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Singleton::$uniqueInstance private static property
Singleton::getInstance public static function
Singleton::__clone final private function
Singleton::__construct protected function