From 2ab2312272390c6514d5418334623087a043d91e Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Wed, 25 Sep 2013 09:23:54 +0200 Subject: [PATCH] It's better if we can make $this->master usable everywhere. Using it through a getter can mean that it is not pass by reference. --- inc/vObject.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/inc/vObject.php b/inc/vObject.php index f92682e..b2487d6 100644 --- a/inc/vObject.php +++ b/inc/vObject.php @@ -15,10 +15,7 @@ abstract class vObject { protected $master; function __construct(&$master = null){ - if(isset($master)){ - $this->master = &$master; - } - + $this->master = isset($master) ? $master : $this; } @@ -40,7 +37,7 @@ abstract class vObject { } public function getMaster(){ - return isset($this->master) ? $this->master : $this; + return $this->master; } /** -- 2.11.4.GIT