From 79b089e6d3f8cf6840f6c5b1501bc985435df01b Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 25 Aug 2022 19:52:56 +0200 Subject: Fix PHP8 warnings (#8677) --- plugins/managesieve/lib/Roundcube/rcube_sieve_script.php | 12 ++++++------ program/lib/Roundcube/rcube_result_index.php | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php b/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php index 6c40b0baa..dde6f382d 100644 --- a/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php +++ b/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php @@ -249,13 +249,13 @@ class rcube_sieve_script $tests[$i] = ''; switch ($test['test']) { case 'size': - $tests[$i] .= ($test['not'] ? 'not ' : ''); + $tests[$i] .= (!empty($test['not']) ? 'not ' : ''); $tests[$i] .= 'size :' . ($test['type'] == 'under' ? 'under ' : 'over ') . $test['arg']; break; case 'spamtest': array_push($exts, 'spamtest'); - $tests[$i] .= ($test['not'] ? 'not ' : ''); + $tests[$i] .= (!empty($test['not']) ? 'not ' : ''); $tests[$i] .= $test['test']; $this->add_operator($test, $tests[$i], $exts); @@ -281,7 +281,7 @@ class rcube_sieve_script array_push($exts, 'variables'); } - $tests[$i] .= ($test['not'] ? 'not ' : ''); + $tests[$i] .= (!empty($test['not']) ? 'not ' : ''); $tests[$i] .= $test['test']; if ($test['test'] == 'header') { @@ -301,7 +301,7 @@ class rcube_sieve_script array_push($exts, 'envelope'); } - $tests[$i] .= ($test['not'] ? 'not ' : ''); + $tests[$i] .= (!empty($test['not']) ? 'not ' : ''); $tests[$i] .= $test['test']; if ($test['test'] == 'address') { @@ -326,7 +326,7 @@ class rcube_sieve_script case 'body': array_push($exts, 'body'); - $tests[$i] .= ($test['not'] ? 'not ' : '') . 'body'; + $tests[$i] .= (!empty($test['not']) ? 'not ' : '') . 'body'; if (!empty($test['part'])) { $tests[$i] .= ' :' . $test['part']; @@ -345,7 +345,7 @@ class rcube_sieve_script case 'currentdate': array_push($exts, 'date'); - $tests[$i] .= ($test['not'] ? 'not ' : '') . $test['test']; + $tests[$i] .= (!empty($test['not']) ? 'not ' : '') . $test['test']; $this->add_index($test, $tests[$i], $exts); diff --git a/program/lib/Roundcube/rcube_result_index.php b/program/lib/Roundcube/rcube_result_index.php index 9636761e1..0180d62db 100644 --- a/program/lib/Roundcube/rcube_result_index.php +++ b/program/lib/Roundcube/rcube_result_index.php @@ -413,18 +413,18 @@ class rcube_result_index * Returns response parameters, e.g. ESEARCH's MIN/MAX/COUNT/ALL/MODSEQ * or internal data e.g. MAILBOX, ORDER * - * @param string $param Parameter name + * @param ?string $param Parameter name * * @return array|string Response parameters or parameter value */ - public function get_parameters($param=null) + public function get_parameters($param = null) { $params = $this->params; $params['MAILBOX'] = $this->mailbox; $params['ORDER'] = $this->order; if ($param !== null) { - return $params[$param]; + return $params[$param] ?? null; } return $params; -- cgit v1.2.3