File tree Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ class GovernmentOfUSA
8787 // For non-static just use $this
8888
8989 // Make sure the instance is only registered once
90- $instance->ensureNotAlreadyInitialized ();
90+ $instance->ensureNotInitialized ();
9191
9292 // Do something
9393 // ...
@@ -102,7 +102,7 @@ class GovernmentOfUSA
102102 public function takeOverTheWorld(): void
103103 {
104104 // Make sure the instance is initialized
105- $this->ensureAlreadyInitialized ();
105+ $this->ensureInitialized ();
106106
107107 // Do something
108108 // ...
Original file line number Diff line number Diff line change 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.1 " ,
4+ "version" : " 1.0.2 " ,
55 "type" : " library" ,
66 "homepage" : " https://github.com/okapi-web/php-singleton" ,
77 "license" : " MIT" ,
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ protected function setInitialized(): void
7474 *
7575 * @return void
7676 */
77- protected function ensureNotAlreadyInitialized (): void
77+ protected function ensureNotInitialized (): void
7878 {
7979 if (self ::isInitialized ()) {
8080 throw new AlreadyInitializedException (get_called_class ());
@@ -86,7 +86,7 @@ protected function ensureNotAlreadyInitialized(): void
8686 *
8787 * @return void
8888 */
89- protected function ensureAlreadyInitialized (): void
89+ protected function ensureInitialized (): void
9090 {
9191 if (!self ::isInitialized ()) {
9292 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
1212 {
1313 $ instance = self ::getInstance ();
1414
15- $ instance ->ensureNotAlreadyInitialized ();
15+ $ instance ->ensureNotInitialized ();
1616
1717 $ instance ->setInitialized ();
1818 }
@@ -21,6 +21,6 @@ public static function takeOverTheWorld(): void
2121 {
2222 $ instance = self ::getInstance ();
2323
24- $ instance ->ensureAlreadyInitialized ();
24+ $ instance ->ensureInitialized ();
2525 }
2626}
You can’t perform that action at this time.
0 commit comments