From 9c30a3d3273dd5916753e986d56246a9970d001f Mon Sep 17 00:00:00 2001 From: Elena.Budnik <ebudnik@irap.omp.eu> Date: Tue, 9 Jun 2020 18:56:39 +0200 Subject: [PATCH] arg default in constructor --- php/classes/Guest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/php/classes/Guest.php b/php/classes/Guest.php index 1e5b3b1..a23e547 100644 --- a/php/classes/Guest.php +++ b/php/classes/Guest.php @@ -10,12 +10,12 @@ class Guest { private $guestXml, $guestXmlFile, $xp, $root; public $Id, $Start, $Ip, $email; - function __construct($Ip_, $email_){ + function __construct($Ip_, $email_ = null){ - if($email_ != null) { + if($email_) { $this->Start = getdate(); $this->Ip = $Ip_; - $this->email = $email_; + $this->email = $email_; } else { $this->Id = substr($Ip_,strlen("guest")); @@ -31,7 +31,7 @@ class Guest { $this->guestXml->load($this->guestXmlFile); $this->root = $this->guestXml->getElementsByTagName("guests")->item(0); } - $this->xp = new domxpath($this->guestXml); + $this->xp = new domxpath($this->guestXml); } private function generateXML() { -- libgit2 0.21.2