You are here

class Singleton in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/tests/_files/Singleton.php \Singleton

Hierarchy

Expanded class hierarchy of Singleton

File

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 self();
    }
    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