Чётче синглтон.
This commit is contained in:
parent
d2cf95ef55
commit
49a7f3a273
@ -9,7 +9,7 @@ use User\ItemsModel;
|
|||||||
|
|
||||||
class User
|
class User
|
||||||
{
|
{
|
||||||
private static self $flag_one;
|
private static ?self $flag_one = null;
|
||||||
public int $pokol = 2; //Акктуальное поколение предметов
|
public int $pokol = 2; //Акктуальное поколение предметов
|
||||||
public array $aves = ['now' => 0, 'max' => 0];
|
public array $aves = ['now' => 0, 'max' => 0];
|
||||||
public array $room = [];
|
public array $room = [];
|
||||||
@ -804,9 +804,9 @@ class User
|
|||||||
/** Singletone.
|
/** Singletone.
|
||||||
* @return User
|
* @return User
|
||||||
*/
|
*/
|
||||||
public static function start(): User
|
public static function start(): self
|
||||||
{
|
{
|
||||||
if (!isset(self::$flag_one)) {
|
if (is_null(self::$flag_one)) {
|
||||||
self::$flag_one = new self();
|
self::$flag_one = new self();
|
||||||
}
|
}
|
||||||
return self::$flag_one;
|
return self::$flag_one;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user