Skip to content

Commit 5fdaa28

Browse files
committed
Made $instance nullable
1 parent 2edb246 commit 5fdaa28

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "okapi/singleton",
33
"description": "PHP Singleton is a PHP library that allows you to create singleton classes with a trait.",
4-
"version": "1.0.0",
4+
"version": "1.0.1",
55
"type": "library",
66
"homepage": "https://github.com/okapi-web/php-singleton",
77
"license": "MIT",

src/Singleton.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ trait Singleton
1515
/**
1616
* Singleton instance.
1717
*
18-
* @var self
18+
* @var self|null
1919
* @noinspection PhpDocFieldTypeMismatchInspection
2020
*/
21-
private static self $instance;
21+
private static ?self $instance = null;
2222

2323
/**
2424
* Whether the instance has been initialized.

0 commit comments

Comments
 (0)