Housekeeping lib_rss.php (#8193)

* Housekeeping lib_rss.php
`lib_rss.php` had become much too large, especially after https://github.com/FreshRSS/FreshRSS/pull/7924
Moved most functions to other places.
Mostly no change of code otherwise (see comments).

* Extension: composer run-script phpstan-third-party
This commit is contained in:
Alexandre Alapetite
2025-11-11 08:17:12 +01:00
committed by GitHub
parent 5e622c60fa
commit a18c35046d
44 changed files with 1016 additions and 989 deletions

View File

@@ -350,4 +350,22 @@ class FreshRSS_UserQuery {
public function setImageUrl(string $imageUrl): void {
$this->imageUrl = $imageUrl;
}
/**
* Remove queries where $get is appearing.
* @param string $get the get attribute which should be removed.
* @param array<int,array{get?:string,name?:string,order?:string,search?:string,state?:int,url?:string,token?:string,
* shareRss?:bool,shareOpml?:bool,description?:string,imageUrl?:string}> $queries an array of queries.
* @return array<int,array{get?:string,name?:string,order?:string,search?:string,state?:int,url?:string,token?:string,
* shareRss?:bool,shareOpml?:bool,description?:string,imageUrl?:string}> without queries where $get is appearing.
*/
public static function remove_query_by_get(string $get, array $queries): array {
$final_queries = [];
foreach ($queries as $query) {
if (empty($query['get']) || $query['get'] !== $get) {
$final_queries[] = $query;
}
}
return $final_queries;
}
}