mirror of https://github.com/openvk/chandler.git
17 lines
334 B
PHP
17 lines
334 B
PHP
<?php declare(strict_types=1);
|
|
namespace Chandler\Patterns;
|
|
|
|
trait TSimpleSingleton
|
|
{
|
|
private static $self = NULL;
|
|
|
|
private function __construct() {}
|
|
private function __clone() {}
|
|
private function __wakeup() {}
|
|
|
|
static function i()
|
|
{
|
|
return static::$self ?? static::$self = new static;
|
|
}
|
|
}
|