public static function Singleton::getInstance in Anti Spam by CleanTalk 8.4
Same name and namespace in other branches
- 9.1.x src/lib/Cleantalk/Common/Templates/Singleton.php \Cleantalk\Common\Templates\Singleton::getInstance()
Constructor
Return value
$this
File
- src/
lib/ Cleantalk/ Common/ Templates/ Singleton.php, line 27
Class
- Singleton
- Trait Singleton
Namespace
Cleantalk\Common\TemplatesCode
public static function getInstance() {
$args = func_get_args();
if (!isset(static::$instance) || !$args) {
static::$instance = new static();
if (!empty($args)) {
static::$instance
->init($args);
}
else {
static::$instance
->init();
}
}
return static::$instance;
}