From 8d87391aa152162c733f23fadae0ba29d1910c36 Mon Sep 17 00:00:00 2001 From: Ali Nazari Date: Fri, 30 Apr 2021 01:22:29 +0430 Subject: [PATCH] re-add __clone I re-added the `__clone` method which removed in the last commit. --- Creational/Singleton/Singleton.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Creational/Singleton/Singleton.php b/Creational/Singleton/Singleton.php index ebad0a648..d4ea3a23e 100644 --- a/Creational/Singleton/Singleton.php +++ b/Creational/Singleton/Singleton.php @@ -28,6 +28,13 @@ private function __construct() { } + /** + * prevent the instance from being cloned (which would create a second instance of it) + */ + private function __clone() + { + } + /** * prevent from being unserialized (which would create a second instance of it) */