From 0f6709c751c4b8612b29e1069698087acdd4b611 Mon Sep 17 00:00:00 2001 From: Bocharsky Victor Date: Fri, 19 Dec 2014 11:09:40 +0200 Subject: [PATCH 1/2] Use static property instead of static variable I think better to use OOP static property for Singleton class like in other resources, isn't it? - (domnikl/DesignPatternsPHP Singleton)[https://github.com/domnikl/DesignPatternsPHP/blob/master/Creational/Singleton/Singleton.php#L13] - (Singleton Wiki)[https://uk.wikipedia.org/wiki/%D0%9E%D0%B4%D0%B8%D0%BD%D0%B0%D0%BA_(%D1%88%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD_%D0%BF%D1%80%D0%BE%D0%B5%D0%BA%D1%82%D1%83%D0%B2%D0%B0%D0%BD%D0%BD%D1%8F)#.D0.A0.D0.B5.D0.B0.D0.BB.D1.96.D0.B7.D0.B0.D1.86.D1.96.D1.8F_.D0.BD.D0.B0_PHP5] --- pages/Design-Patterns.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pages/Design-Patterns.md b/pages/Design-Patterns.md index 7e57cb9..9aeaadd 100644 --- a/pages/Design-Patterns.md +++ b/pages/Design-Patterns.md @@ -72,21 +72,23 @@ one instance of a particular class. The singleton pattern enables us to do this. Date: Fri, 19 Dec 2014 11:36:14 +0200 Subject: [PATCH 2/2] Use @var instead of obsolete @static tag --- pages/Design-Patterns.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/Design-Patterns.md b/pages/Design-Patterns.md index 9aeaadd..e5c3eb9 100644 --- a/pages/Design-Patterns.md +++ b/pages/Design-Patterns.md @@ -73,7 +73,7 @@ one instance of a particular class. The singleton pattern enables us to do this. class Singleton { /** - * @static Singleton The reference to *Singleton* instance of this class + * @var Singleton The reference to *Singleton* instance of this class */ private static $instance;