aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2025-08-07 22:19:45 +0200
committerGravatar GitHub <noreply@github.com> 2025-08-07 22:19:45 +0200
commit62f32ccadff77594f5b8e3ad24c4c2541ff35885 (patch)
tree29689e66fd16fcbeb385cda554890d45d66e58c2 /app
parent149136fbe252cca4cb8dcdb463df135094bc0f87 (diff)
PHPStan: finalise strictArrayFilter (#7794)
As well as reportPossiblyNonexistentConstantArrayOffset. And disable PHPStan-next from GitHub Action, since the work is completed for now.
Diffstat (limited to 'app')
-rw-r--r--app/Controllers/configureController.php2
-rwxr-xr-xapp/Controllers/feedController.php2
-rw-r--r--app/Controllers/subscriptionController.php4
-rw-r--r--app/Models/Entry.php2
-rw-r--r--app/Models/UserQuery.php2
5 files changed, 6 insertions, 6 deletions
diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php
index dc5407e99..6c1561d7c 100644
--- a/app/Controllers/configureController.php
+++ b/app/Controllers/configureController.php
@@ -386,7 +386,7 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController {
$this->view->tags = FreshRSS_Context::labels();
if (Minz_Request::isPost()) {
- $params = array_filter(Minz_Request::paramArray('query'));
+ $params = Minz_Request::paramArray('query');
$queryParams = [];
$name = Minz_Request::paramString('name') ?: _t('conf.query.number', $id + 1);
if ('' === $name) {
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php
index 977143882..97d68883c 100755
--- a/app/Controllers/feedController.php
+++ b/app/Controllers/feedController.php
@@ -221,7 +221,7 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
}
}
- $headers = array_filter(array_map('trim', $headers));
+ $headers = array_filter($headers, fn(string $header): bool => trim($header) !== '');
if (!empty($headers)) {
$opts[CURLOPT_HTTPHEADER] = array_merge($headers, $opts[CURLOPT_HTTPHEADER] ?? []);
$opts[CURLOPT_HTTPHEADER] = array_unique($opts[CURLOPT_HTTPHEADER]);
diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php
index 70065fc26..424b9a776 100644
--- a/app/Controllers/subscriptionController.php
+++ b/app/Controllers/subscriptionController.php
@@ -207,7 +207,7 @@ class FreshRSS_subscription_Controller extends FreshRSS_ActionController {
}
}
- $headers = array_filter(array_map('trim', $headers));
+ $headers = array_filter($headers, fn(string $header): bool => trim($header) !== '');
if (!empty($headers)) {
$opts[CURLOPT_HTTPHEADER] = array_merge($headers, $opts[CURLOPT_HTTPHEADER] ?? []);
$opts[CURLOPT_HTTPHEADER] = array_unique($opts[CURLOPT_HTTPHEADER]);
@@ -318,7 +318,7 @@ class FreshRSS_subscription_Controller extends FreshRSS_ActionController {
}
$conditions = Minz_Request::paramTextToArray('path_entries_conditions', plaintext: true);
- $conditions = array_filter(array_map('trim', $conditions));
+ $conditions = array_filter($conditions, fn(string $condition): bool => trim($condition) !== '');
$feed->_attribute('path_entries_conditions', empty($conditions) ? null : $conditions);
$feed->_attribute('path_entries_filter', Minz_Request::paramString('path_entries_filter', true));
diff --git a/app/Models/Entry.php b/app/Models/Entry.php
index 7ba0d3793..7254dd513 100644
--- a/app/Models/Entry.php
+++ b/app/Models/Entry.php
@@ -860,7 +860,7 @@ HTML;
}
$conditions = $feed->attributeArray('path_entries_conditions') ?? [];
- $conditions = array_filter(array_map(fn($v) => is_string($v) ? trim($v) : '', $conditions));
+ $conditions = array_filter($conditions, fn($v): bool => (is_string($v) ? trim($v) : '') !== '');
if (count($conditions) > 0) {
$found = false;
foreach ($conditions as $condition) {
diff --git a/app/Models/UserQuery.php b/app/Models/UserQuery.php
index 196d0126e..c78eeccd3 100644
--- a/app/Models/UserQuery.php
+++ b/app/Models/UserQuery.php
@@ -124,7 +124,7 @@ class FreshRSS_UserQuery {
'shareOpml' => $this->shareOpml,
'description' => $this->description,
'imageUrl' => $this->imageUrl,
- ]);
+ ], fn($v): bool => $v !== '' && $v !== 0 && $v !== false);
}
/**