From 93e111a61516b1b9525c331fdb5f7a400957385e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 15 Jun 2024 16:03:53 +0200 Subject: [PATCH] fix phpstan is falsy (#30016) --- htdocs/comm/propal/class/propal.class.php | 8 ++++---- htdocs/commande/class/commande.class.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index acb543631d6..a3d9343cad7 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -3667,14 +3667,14 @@ class Propal extends CommonObject } $datas['customer'] = '
'.$langs->trans('Customer').': '.$this->thirdparty->getNomUrl(1, '', 0, 1); } - if (!empty($this->ref_client)) { - $datas['refcustomer'] = '
'.$langs->trans('RefCustomer').': '.$this->ref_client; + if (!empty($this->ref_customer)) { + $datas['refcustomer'] = '
'.$langs->trans('RefCustomer').': '.$this->ref_customer; } if (!$nofetch) { $langs->load('project'); - if (empty($this->project)) { + if (is_null($this->project) || (is_object($this->project) && $this->project->isEmpty())) { $res = $this->fetch_project(); - if ($res > 0 && !empty($this->project) && $this->project instanceof Project) { + if ($res > 0 && $this->project instanceof Project) { $datas['project'] = '
'.$langs->trans('Project').': '.$this->project->getNomUrl(1, '', 0, 1); } } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 1ef4754bae4..290dd95235c 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3755,9 +3755,9 @@ class Commande extends CommonOrder $datas['RefCustomer'] = '
'.$langs->trans('RefCustomer').': '.(empty($this->ref_customer) ? (empty($this->ref_client) ? '' : $this->ref_client) : $this->ref_customer); if (!$nofetch) { $langs->load('project'); - if (empty($this->project)) { + if (is_null($this->project) || (is_object($this->project) && $this->project->isEmpty())) { $res = $this->fetch_project(); - if ($res > 0 && !empty($this->project) && $this->project instanceof Project) { + if ($res > 0 && $this->project instanceof Project) { $datas['project'] = '
'.$langs->trans('Project').': '.$this->project->getNomUrl(1, '', 0, 1); } }