From 839017288936681f4382882a31cb5c17834bc5cf Mon Sep 17 00:00:00 2001 From: Dave MacFarlane Date: Tue, 15 Aug 2023 13:31:49 -0400 Subject: [PATCH] [instrument_list] Fix deprecation warning Fix the warnings: ``` Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in modules/instrument_list/php/instrument_list_controlpanel.class.inc on line 475

Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in modules/instrument_list/php/instrument_list_controlpanel.class.inc on line 514
``` in PHP 8.2 and above. --- .../php/instrument_list_controlpanel.class.inc | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/modules/instrument_list/php/instrument_list_controlpanel.class.inc b/modules/instrument_list/php/instrument_list_controlpanel.class.inc index 463c6256a4d..ec102d096ec 100644 --- a/modules/instrument_list/php/instrument_list_controlpanel.class.inc +++ b/modules/instrument_list/php/instrument_list_controlpanel.class.inc @@ -471,11 +471,8 @@ class Instrument_List_ControlPanel extends \TimePoint $qcStatus = $this->getBVLQCStatus(); foreach ($this->bvlQcTypes as $type) { - $isSelected =$type == $this->getBVLQCType(); - $type =strtolower($type); - if ($type==null) { - $type ="none"; - } + $isSelected = $type == $this->getBVLQCType(); + $type = strtolower($type ?? 'none'); if ($isSelected) { $this->tpl_data['bvl_qc_type_'.$type]['icon'] = 'far fa-check-square'; @@ -510,11 +507,8 @@ class Instrument_List_ControlPanel extends \TimePoint $qcType = $this->getBVLQCType(); foreach ($this->bvlQcStatuses as $status) { - $isSelected =$status == $this->getBVLQCStatus(); - $status =strtolower($status); - if ($status==null) { - $status ="none"; - } + $isSelected = $status == $this->getBVLQCStatus(); + $status = strtolower($status ?? 'none'); if ($isSelected) { $this->tpl_data['bvl_qc_status_'.$status]['icon'] = 'far fa-check-square';