aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Feed.php
diff options
context:
space:
mode:
authorGravatar maTh <1645099+math-GH@users.noreply.github.com> 2024-04-25 08:28:42 +0200
committerGravatar GitHub <noreply@github.com> 2024-04-25 08:28:42 +0200
commit154a36700c80191121afec00b026daba5ff97dc8 (patch)
treea0693104fd8232fb85d5d25c34f3700efd40c1e2 /app/Models/Feed.php
parent5e66adcc51446fe93b2cba7c25e28a06d9903223 (diff)
Refactoring: Rename dotpath into dotnotation (#6369)
* KIND_JSON_DOTPATH -> KIND_JSON_DOTNOTATION * TYPE_JSON_DOTPATH => TYPE_JSON_DOTNOTATION * json_dotpath => json_dotnotation * dotPathsForStandardJsonFeed => dotNotationForStandardJsonFeed * TYPE_JSON_DOTNOTATION = 'JSON+DotPath' => 'JSON+DotNotation' * documentation: OPML.md * convertJsonToRss() * $dotpaths => $dotnotations * FreshRSS_Feed_Exception * comment * Compatibility TYPE_JSON_DOTPATH --------- Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'app/Models/Feed.php')
-rw-r--r--app/Models/Feed.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/Models/Feed.php b/app/Models/Feed.php
index ac2b2554f..efee3840f 100644
--- a/app/Models/Feed.php
+++ b/app/Models/Feed.php
@@ -31,7 +31,7 @@ class FreshRSS_Feed extends Minz_Model {
public const KIND_JSON_XPATH = 20;
public const KIND_JSONFEED = 25;
- public const KIND_JSON_DOTPATH = 30;
+ public const KIND_JSON_DOTNOTATION = 30;
public const PRIORITY_IMPORTANT = 20;
public const PRIORITY_MAIN_STREAM = 10;
@@ -621,7 +621,7 @@ class FreshRSS_Feed extends Minz_Model {
}
/** @return array<string,string> */
- private function dotPathsForStandardJsonFeed(): array {
+ private function dotNotationForStandardJsonFeed(): array {
return [
'feedTitle' => 'title',
'item' => 'items',
@@ -662,11 +662,11 @@ class FreshRSS_Feed extends Minz_Model {
return null;
}
- /** @var array<string,string> $json_dotpath */
- $json_dotpath = $this->attributeArray('json_dotpath') ?? [];
- $dotPaths = $this->kind() === FreshRSS_Feed::KIND_JSONFEED ? $this->dotPathsForStandardJsonFeed() : $json_dotpath;
+ /** @var array<string,string> $json_dotnotation */
+ $json_dotnotation = $this->attributeArray('json_dotnotation') ?? [];
+ $dotnotations = $this->kind() === FreshRSS_Feed::KIND_JSONFEED ? $this->dotNotationForStandardJsonFeed() : $json_dotnotation;
- $feedContent = FreshRSS_dotNotation_Util::convertJsonToRss($jf, $feedSourceUrl, $dotPaths, $this->name());
+ $feedContent = FreshRSS_dotNotation_Util::convertJsonToRss($jf, $feedSourceUrl, $dotnotations, $this->name());
if ($feedContent == null) {
return null;
}