aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/updateController.php
diff options
context:
space:
mode:
authorGravatar Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> 2024-11-28 17:11:04 +0100
committerGravatar GitHub <noreply@github.com> 2024-11-28 17:11:04 +0100
commit15745d42b779ad14efde2932ab116f45eee39246 (patch)
tree2528a36184d8152d4f2d90dc73df680f84bbe1d1 /app/Controllers/updateController.php
parent604b186638276203c8495a3ee86da0cc240ab4d0 (diff)
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 <l.sanchez-prestataire@alptis.fr> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'app/Controllers/updateController.php')
-rw-r--r--app/Controllers/updateController.php7
1 files changed, 3 insertions, 4 deletions
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'),