diff options
| author | 2025-11-11 08:17:12 +0100 | |
|---|---|---|
| committer | 2025-11-11 08:17:12 +0100 | |
| commit | a18c35046daee15e7ac5f85db290d54541a03e3c (patch) | |
| tree | ec638cf7c93537a4f81b27216097d8509252eb81 /app/Models/UserQuery.php | |
| parent | 5e622c60fa5c40793138807280319f7e84d00cc6 (diff) | |
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
Diffstat (limited to 'app/Models/UserQuery.php')
| -rw-r--r-- | app/Models/UserQuery.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/Models/UserQuery.php b/app/Models/UserQuery.php index 26264fa24..6050436f4 100644 --- a/app/Models/UserQuery.php +++ b/app/Models/UserQuery.php @@ -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; + } } |
