aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/app/Models/ViewJavascript.php
diff options
context:
space:
mode:
authorAlexandre Alapetite <alexandre@alapetite.fr>2023-05-11 12:53:32 +0200
committerGitHub <noreply@github.com>2023-05-11 12:53:32 +0200
commitfe7d9bbcd68660a59b813346c236b61b25a51c80 (patch)
tree95be837c2838659a3ea72974c9f9b18b1ee634ca /app/Models/ViewJavascript.php
parent2343f0ded14ac6970575c23e4de34e536241b623 (diff)
downloadfreshrss-fe7d9bbcd68660a59b813346c236b61b25a51c80.tar.gz
freshrss-fe7d9bbcd68660a59b813346c236b61b25a51c80.zip
Typed view model classes (#5380)
* Typed view model classes * Add ability to provide a typed view model class to a controller * Use `::class` instead of string for referring to classes * Examplified with `stats` and `javascript` controllers / views (more to do) * Also useful for extensions (my usecase today), which did not have the ability to define own view model attributes before. * Typo
Diffstat (limited to 'app/Models/ViewJavascript.php')
-rw-r--r--app/Models/ViewJavascript.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/Models/ViewJavascript.php b/app/Models/ViewJavascript.php
new file mode 100644
index 000000000..f14810572
--- /dev/null
+++ b/app/Models/ViewJavascript.php
@@ -0,0 +1,16 @@
+<?php
+
+final class FreshRSS_ViewJavascript extends FreshRSS_View {
+
+ /** @var array<FreshRSS_Category> */
+ public $categories;
+ /** @var array<FreshRSS_Feed> */
+ public $feeds;
+ /** @var array<FreshRSS_Tag> */
+ public $tags;
+
+ /** @var string */
+ public $nonce;
+ /** @var string */
+ public $salt1;
+}