aboutsummaryrefslogtreecommitdiff
path: root/app/views/helpers
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2021-12-31 17:00:51 +0100
committerGravatar GitHub <noreply@github.com> 2021-12-31 17:00:51 +0100
commit77e9877316fcfacb26799afdf32d94c8411da80e (patch)
tree7fd9c85bf4854054be6536c14d120bc8b790debe /app/views/helpers
parent09c84fb3bc44bf8e45619c27acc15b967aea14ce (diff)
Add PHPStan (#4021)
* Add PHPStan #fix https://github.com/FreshRSS/FreshRSS/issues/4016 https://phpstan.org/ ```sh composer run-script phpstan ``` * More fixes * Fix global variables * Add .phtml * Fix merge https://github.com/FreshRSS/FreshRSS/pull/4090 * Fix more warnings * Fix view errors and enable in CI * ReturnTypeWillChange * Dynamic view type * Fix Minz static/self bug
Diffstat (limited to 'app/views/helpers')
-rw-r--r--app/views/helpers/category/update.phtml3
-rw-r--r--app/views/helpers/configure/query.phtml1
-rw-r--r--app/views/helpers/export/articles.phtml1
-rw-r--r--app/views/helpers/export/opml.phtml1
-rw-r--r--app/views/helpers/extension/configure.phtml1
-rw-r--r--app/views/helpers/extension/details.phtml1
-rw-r--r--app/views/helpers/feed/update.phtml1
-rw-r--r--app/views/helpers/index/normal/entry_bottom.phtml1
-rw-r--r--app/views/helpers/index/normal/entry_header.phtml1
-rw-r--r--app/views/helpers/javascript_vars.phtml1
-rwxr-xr-xapp/views/helpers/logs_pagination.phtml6
-rwxr-xr-xapp/views/helpers/pagination.phtml1
12 files changed, 17 insertions, 2 deletions
diff --git a/app/views/helpers/category/update.phtml b/app/views/helpers/category/update.phtml
index 085b49aa6..291dd7fc4 100644
--- a/app/views/helpers/category/update.phtml
+++ b/app/views/helpers/category/update.phtml
@@ -1,3 +1,4 @@
+<?php /** @var FreshRSS_View $this */ ?>
<div class="post">
<h2><?= $this->category->name() ?></h2>
@@ -30,7 +31,7 @@
<div class="group-controls">
<button class="btn btn-important"><?= _t('gen.action.submit') ?></button>
<button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button>
-
+
</div>
</div>
diff --git a/app/views/helpers/configure/query.phtml b/app/views/helpers/configure/query.phtml
index a9bf4478d..3dc6c2459 100644
--- a/app/views/helpers/configure/query.phtml
+++ b/app/views/helpers/configure/query.phtml
@@ -1,3 +1,4 @@
+<?php /** @var FreshRSS_View $this */ ?>
<div class="post">
<h2><?= $this->query->getName() ?></h2>
diff --git a/app/views/helpers/export/articles.phtml b/app/views/helpers/export/articles.phtml
index 0bbfb86ec..c131b8474 100644
--- a/app/views/helpers/export/articles.phtml
+++ b/app/views/helpers/export/articles.phtml
@@ -1,4 +1,5 @@
<?php
+/** @var FreshRSS_View $this */
$username = Minz_Session::param('currentUser', '_');
$options = JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE;
diff --git a/app/views/helpers/export/opml.phtml b/app/views/helpers/export/opml.phtml
index edb4d4eda..971dc1445 100644
--- a/app/views/helpers/export/opml.phtml
+++ b/app/views/helpers/export/opml.phtml
@@ -1,4 +1,5 @@
<?php
+/** @var FreshRSS_View $this */
$opml_array = array(
'head' => array(
diff --git a/app/views/helpers/extension/configure.phtml b/app/views/helpers/extension/configure.phtml
index 4f8c521ae..ea68287b1 100644
--- a/app/views/helpers/extension/configure.phtml
+++ b/app/views/helpers/extension/configure.phtml
@@ -1,3 +1,4 @@
+<?php /** @var FreshRSS_View $this */ ?>
<div class="post">
<h2>
<?= $this->extension->getName() ?> (<?= $this->extension->getVersion() ?>) —
diff --git a/app/views/helpers/extension/details.phtml b/app/views/helpers/extension/details.phtml
index ed9674e3d..f6b361c6f 100644
--- a/app/views/helpers/extension/details.phtml
+++ b/app/views/helpers/extension/details.phtml
@@ -1,3 +1,4 @@
+<?php /** @var FreshRSS_View $this */ ?>
<ul class="horizontal-list">
<li class="item">
<?php if ($this->ext_details->getType() === 'user' || FreshRSS_Auth::hasAccess('admin')) { ?>
diff --git a/app/views/helpers/feed/update.phtml b/app/views/helpers/feed/update.phtml
index 703de3202..949c6492f 100644
--- a/app/views/helpers/feed/update.phtml
+++ b/app/views/helpers/feed/update.phtml
@@ -1,3 +1,4 @@
+<?php /** @var FreshRSS_View $this */ ?>
<div class="post">
<h1><?= $this->feed->name() ?></h1>
diff --git a/app/views/helpers/index/normal/entry_bottom.phtml b/app/views/helpers/index/normal/entry_bottom.phtml
index bf1dc7b3d..07e68ed92 100644
--- a/app/views/helpers/index/normal/entry_bottom.phtml
+++ b/app/views/helpers/index/normal/entry_bottom.phtml
@@ -1,4 +1,5 @@
<?php
+ /** @var FreshRSS_View $this */
$sharing = array();
if (FreshRSS_Auth::hasAccess()) {
$sharing = FreshRSS_Context::$user_conf->sharing;
diff --git a/app/views/helpers/index/normal/entry_header.phtml b/app/views/helpers/index/normal/entry_header.phtml
index 784a440a0..79e6e4215 100644
--- a/app/views/helpers/index/normal/entry_header.phtml
+++ b/app/views/helpers/index/normal/entry_header.phtml
@@ -1,4 +1,5 @@
<?php
+ /** @var FreshRSS_View $this */
$topline_read = FreshRSS_Context::$user_conf->topline_read;
$topline_favorite = FreshRSS_Context::$user_conf->topline_favorite;
$topline_thumbnail = FreshRSS_Context::$user_conf->topline_thumbnail;
diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml
index 256b6bf5f..3860c6204 100644
--- a/app/views/helpers/javascript_vars.phtml
+++ b/app/views/helpers/javascript_vars.phtml
@@ -1,4 +1,5 @@
<?php
+/** @var FreshRSS_View $this */
$mark = FreshRSS_Context::$user_conf->mark_when;
$s = FreshRSS_Context::$user_conf->shortcuts;
$extData = Minz_ExtensionManager::callHook('js_vars', []);
diff --git a/app/views/helpers/logs_pagination.phtml b/app/views/helpers/logs_pagination.phtml
index fa69d0b44..fe6a71a3a 100755
--- a/app/views/helpers/logs_pagination.phtml
+++ b/app/views/helpers/logs_pagination.phtml
@@ -1,4 +1,5 @@
<?php
+ /** @var FreshRSS_View $this */
$c = Minz_Request::controllerName();
$a = Minz_Request::actionName();
$params = $_GET;
@@ -6,7 +7,10 @@
<?php if ($this->nbPage > 1) { ?>
<ul class="pagination">
- <?php $params[$getteur] = 1; ?>
+ <?php
+ /** @var int $getteur */
+ $params[$getteur] = 1;
+ ?>
<li class="item pager-first">
<?php if ($this->currentPage > 1) { ?>
<a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>">« <?= _t('gen.pagination.first') ?></a>
diff --git a/app/views/helpers/pagination.phtml b/app/views/helpers/pagination.phtml
index cefa835bd..9b249762c 100755
--- a/app/views/helpers/pagination.phtml
+++ b/app/views/helpers/pagination.phtml
@@ -1,4 +1,5 @@
<?php
+ /** @var FreshRSS_View $this */
$url_next = Minz_Request::currentRequest();
$url_next['params']['next'] = FreshRSS_Context::$next_id;
$url_next['params']['state'] = FreshRSS_Context::$state;