File tree 4 files changed +7
-7
lines changed
4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ class GovernmentOfUSA
87
87
// For non-static just use $this
88
88
89
89
// Make sure the instance is only registered once
90
- $instance->ensureNotAlreadyInitialized ();
90
+ $instance->ensureNotInitialized ();
91
91
92
92
// Do something
93
93
// ...
@@ -102,7 +102,7 @@ class GovernmentOfUSA
102
102
public function takeOverTheWorld(): void
103
103
{
104
104
// Make sure the instance is initialized
105
- $this->ensureAlreadyInitialized ();
105
+ $this->ensureInitialized ();
106
106
107
107
// Do something
108
108
// ...
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " okapi/singleton" ,
3
3
"description" : " PHP Singleton is a PHP library that allows you to create singleton classes with a trait." ,
4
- "version" : " 1.0.1 " ,
4
+ "version" : " 1.0.2 " ,
5
5
"type" : " library" ,
6
6
"homepage" : " https://github.com/okapi-web/php-singleton" ,
7
7
"license" : " MIT" ,
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ protected function setInitialized(): void
74
74
*
75
75
* @return void
76
76
*/
77
- protected function ensureNotAlreadyInitialized (): void
77
+ protected function ensureNotInitialized (): void
78
78
{
79
79
if (self ::isInitialized ()) {
80
80
throw new AlreadyInitializedException (get_called_class ());
@@ -86,7 +86,7 @@ protected function ensureNotAlreadyInitialized(): void
86
86
*
87
87
* @return void
88
88
*/
89
- protected function ensureAlreadyInitialized (): void
89
+ protected function ensureInitialized (): void
90
90
{
91
91
if (!self ::isInitialized ()) {
92
92
throw new NotInitializedException (get_called_class ());
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ public static function register(): void
12
12
{
13
13
$ instance = self ::getInstance ();
14
14
15
- $ instance ->ensureNotAlreadyInitialized ();
15
+ $ instance ->ensureNotInitialized ();
16
16
17
17
$ instance ->setInitialized ();
18
18
}
@@ -21,6 +21,6 @@ public static function takeOverTheWorld(): void
21
21
{
22
22
$ instance = self ::getInstance ();
23
23
24
- $ instance ->ensureAlreadyInitialized ();
24
+ $ instance ->ensureInitialized ();
25
25
}
26
26
}
You can’t perform that action at this time.
0 commit comments