From 15745d42b779ad14efde2932ab116f45eee39246 Mon Sep 17 00:00:00 2001 From: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> Date: Thu, 28 Nov 2024 17:11:04 +0100 Subject: Upgrade code to php 8.1 (#6748) * revert Fix code indentation Fix code Upgrade code to php 8.1 * fix remarques * code review * code review * code review * Apply suggestions from code review * code review * Fixes * Many remainging updates of array syntax * Lost case 'reading-list' * Uneeded PHPDoc --------- Co-authored-by: Luc Sanchez Co-authored-by: Alexandre Alapetite --- app/Controllers/updateController.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'app/Controllers/updateController.php') diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php index e5bf276cd..c7623d0a4 100644 --- a/app/Controllers/updateController.php +++ b/app/Controllers/updateController.php @@ -89,7 +89,7 @@ class FreshRSS_update_Controller extends FreshRSS_ActionController { chdir($cwd); $line = implode('; ', $output); return $line == '' || - strpos($line, '[behind') !== false || strpos($line, '[ahead') !== false || strpos($line, '[gone') !== false; + str_contains($line, '[behind') || str_contains($line, '[ahead') || str_contains($line, '[gone'); } /** @return string|true */ @@ -169,8 +169,7 @@ class FreshRSS_update_Controller extends FreshRSS_ActionController { } private function is_release_channel_stable(string $currentVersion): bool { - return strpos($currentVersion, 'dev') === false && - strpos($currentVersion, 'edge') === false; + return !str_contains($currentVersion, 'dev') && !str_contains($currentVersion, 'edge'); } /* Check installation if there is a newer version. @@ -239,7 +238,7 @@ class FreshRSS_update_Controller extends FreshRSS_ActionController { $res_array = explode("\n", (string)$result, 2); $status = $res_array[0]; - if (strpos($status, 'UPDATE') !== 0) { + if (!str_starts_with($status, 'UPDATE')) { $this->view->message = [ 'status' => 'latest', 'body' => _t('feedback.update.none'), -- cgit v1.2.3