Commit Graph

11621 Commits

Author SHA1 Message Date
wn_ 0f324b77df Address PHPStan warning and tweak 'tasks'+'interval' handling in 'update_daemon2.php'.
This ensures both are of the expected type (int) and meet a reasonable minimum.
2021-11-11 12:11:33 +00:00
wn_ 7a919a79d7 Fix some additional PHPStan warnings in UrlHelper. 2021-11-11 11:12:40 +00:00
wn_ bf53dfa515 Don't use 'mixed' directly (PHP 8+). 2021-11-10 21:53:28 +00:00
wn_ 4cc3374f9f Initial go at PHPStan rule level 6. 2021-11-10 21:38:25 +00:00
Andrew Dolgov 87a30d88d3 plugin cleanup re: phpstan 1.0 warnings 2021-11-10 20:58:40 +03:00
Andrew Dolgov 9e8d69739f add two helper account access levels:
- read only - can't subscribe to more feeds, feed updates are skipped
 - disabled - can't login
define used access levels as UserHelper constants and refactor code to
use them instead of hardcoded numbers
2021-11-10 20:44:51 +03:00
fox 7a52560e4e Merge pull request 'PHPStan 1.0.0 and related warning fixes' (#49) from wn/tt-rss:feature/phpstan-1.0.0-and-fixes into master
Reviewed-on: https://git.tt-rss.org/fox/tt-rss/pulls/49
2021-11-02 08:37:11 +03:00
wn_ 57436ee0c1 Address PHPStan warning in 'update.php'.
------ --------------------------------------
Line   update.php
------ --------------------------------------
213    While loop condition is always true.
------ --------------------------------------
2021-11-01 21:10:27 +00:00
wn_ 3cc60a0219 Address PHPStan warnings in 'include/colors.php'.
------ ------------------------------------------------------------------
Line   include/colors.php
------ ------------------------------------------------------------------
215    Variable $out might not be defined.
223    Parameter #3 $pad_string of function str_pad expects string, int
        given.
255    Variable $h might not be defined.
317    Variable $img might not be defined.
------ ------------------------------------------------------------------
2021-11-01 21:10:27 +00:00
wn_ 9dac9c5a0d Address PHPStan warnings in 'classes/urlhelper.php'.
Intentionally skipping the line 66 one for now; adding an 'is_array' check clears the warning, but there's a larger topic of how to handle an invalid '' that doesn't result in an array.

------ ---------------------------------------------------------------------
Line   classes/urlhelper.php
------ ---------------------------------------------------------------------
66     Offset 'path' on array{scheme: string} in isset() does not exist.
165    Parameter #2 $associative of function get_headers expects bool, int
        given.
167    Parameter #2 $associative of function get_headers expects bool, int
        given.
278    Negated boolean expression is always true.
309    Negated boolean expression is always true.
------ ---------------------------------------------------------------------
2021-11-01 21:10:27 +00:00
wn_ ac5a4f5937 Address PHPStan warning in 'classes/pref/users.php'.
------ -------------------------------
Line   classes/pref/users.php
------ -------------------------------
170    If condition is always false.
------ -------------------------------
2021-11-01 21:10:27 +00:00
wn_ a38892d5d7 Address PHPStan warning in 'classes/pref/prefs.php'.
------ ------------------------------------------------
Line   classes/pref/prefs.php
------ ------------------------------------------------
1328   Expression on left side of ?? is not nullable.
------ ------------------------------------------------
2021-11-01 21:10:27 +00:00
wn_ 8a920a16e7 Address PHPStan warnings in 'classes/pluginhost.php'.
------ --------------------------------------------------------------------
Line   classes/pluginhost.php
------ --------------------------------------------------------------------
16     Property PluginHost::$last_registered is never read, only written.
386    If condition is always true.
------ --------------------------------------------------------------------
2021-11-01 21:10:27 +00:00
wn_ a7a59fe0e2 Address PHPStan warning in 'classes/logger/sql.php'.
------ --------------------------------------
Line   classes/logger/sql.php
------ --------------------------------------
4      Property Logger_SQL::$pdo is unused.
------ --------------------------------------
2021-11-01 21:10:27 +00:00
wn_ 72cf4f1f0d Address PHPStan warning in 'classes/feeds.php'.
------ ------------------------------------
Line   classes/feeds.php
------ ------------------------------------
8      Property Feeds::$params is unused.
------ ------------------------------------
2021-11-01 21:10:27 +00:00
wn_ 5b17c44e70 Address PHPStan warning in 'classes/feeditem/common.php'.
------ ---------------------------------------------
Line   classes/feeditem/common.php
------ ---------------------------------------------
194    No error to ignore is reported on line 194.
------ ---------------------------------------------
2021-11-01 21:10:27 +00:00
wn_ 7d8837ca17 Address PHPStan warnings in 'classes/db.php'.
------ --------------------------------------------------
Line   classes/db.php
------ --------------------------------------------------
7      Property Db::$link is unused.
86     Property Db::pdo (PDO) in empty() is not falsy.
------ --------------------------------------------------
2021-11-01 21:10:27 +00:00
wn_ 77a98134b8 Address PHPStan warnings in 'classes/config.php'.
------ -----------------------------------------------------------------------
Line   classes/config.php
------ -----------------------------------------------------------------------
3      Constant Config::_ENVVAR_PREFIX is unused.
177    Constant Config::_DEFAULTS is unused.
237    Property Config::$schema_version is never read, only written.
352    Property Config::$migrations (Db_Migrations) in empty() is not falsy.
------ -----------------------------------------------------------------------
2021-11-01 21:10:26 +00:00
wn_ 1584d00891 Bump PHPStan to 1.0.0 2021-11-01 21:10:26 +00:00
Andrew Dolgov 9714c4fbcf Merge branch 'weblate-integration' 2021-10-29 14:10:02 +03:00
Andrew Dolgov 76d8b1bf6f HOOK_ARTICLE_BUTTON/HOOK_ARTICLE_LEFT_BUTTON: only try to parse markup if its actually there 2021-10-26 15:45:12 +03:00
Andrew Dolgov 933913410c css: make plugin button container a flexbox
backend: pass plugin button generated code through domdocument to ensure
its correctness; set data-plugin-name attribute on children to make
them sortable via css
2021-10-24 20:11:49 +03:00
Andrew Dolgov 9f734c9050 minor phpstan tweaks 2021-10-22 13:49:08 +03:00
Andrew Dolgov 3b70d1f622 require phpstan via composer 2021-10-22 13:42:29 +03:00
Andrew Dolgov 2a5c2be6cd af_redditimgur: allow subscribing to teddit.net subreddits directly (rewriting to reddit.com) 2021-10-22 13:25:43 +03:00
Andrew Dolgov 41245da8a6 pluginhost: update comments for HOOK_ constants to use phpdoc syntax; add HOOK_PRE_SUBSCRIBE 2021-10-22 13:24:10 +03:00
Andrew Dolgov 6fe0751038 af_redditimgur: set some @var hints 2021-10-22 12:33:55 +03:00
Andrew Dolgov 377e0b812c add data-orig-feed-title to generated headline markup 2021-10-18 07:44:38 +03:00
Andrew Dolgov dd30825b94 af_comics: pass PluginHost to filter constructors 2021-10-18 07:41:24 +03:00
fox d1ffe6d6cf Merge pull request 'Fix undefined array key "output" when adding new label' (#47) from klempin/tt-rss:master into master
Reviewed-on: https://git.tt-rss.org/fox/tt-rss/pulls/47
2021-10-16 08:18:40 +03:00
Philip Klempin aead30a041 Fix undefined array key "output" when adding new label 2021-10-15 23:05:50 +00:00
Andrew Dolgov a936e80630 OPML improvements/fixes:
* allow CLI import of OPML files (--opml-import)
 * visualize OPML structure when importing
 * add strict type hints to most OPML class methods
2021-10-15 10:06:00 +03:00
Andrew Dolgov 9e7e0e84d7 fix vfeed menu in three panel mode 2021-10-11 13:49:20 +03:00
Andrew Dolgov c6f5902cbc fix wrongly renamed CLI options --debug-force-... to --force-... 2021-10-11 12:18:46 +03:00
Andrew Dolgov a9646b9574 headlines: attach context menu to vfeed title node 2021-10-10 22:17:11 +03:00
Andrew Dolgov 145fc31625 feed tree context menu: add an entry to open originating website 2021-10-10 22:08:17 +03:00
Andrew Dolgov 949e2ab4d2 properly sanitize video poster attribute 2021-09-24 08:40:06 +03:00
TonyRL 23768709d0 Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (665 of 665 strings)

Translation: Tiny Tiny RSS/messages
Translate-URL: https://weblate.tt-rss.org/projects/tt-rss/messages/zh_Hant/
2021-09-22 14:10:57 +00:00
Andrew Dolgov 8ed927dbd2 OPML: multiple fixes
- remove unused integer indexes when exporting filters as JSON
 - fix warning when importing filters without rules
 - properly assign category IDs for category filter rules
 - fix warning: check if outline attributes like xmlUrl are set before trying to use them
 - fix warning: don't try to use libxml_disable_entity_loader on PHP 8
2021-09-08 09:04:15 +03:00
Andrew Dolgov 78ff7770d1 classes/opml: fix indentation; when importing, don't produce warning
on filters with no rules defined.
2021-09-08 08:12:13 +03:00
fox 012a9fdee3 Merge pull request 'Fix undefined index error' (#45) from jpschewe/tt-rss:fix-undefined-index into master
Reviewed-on: https://git.tt-rss.org/fox/tt-rss/pulls/45
2021-09-08 07:40:15 +03:00
Jon Schewe e44f0cb937 Fix undefined index error
Getting $op is handled at the top of the file, use the same variable
at the end of the file to avoid errors about an undefined index.
2021-09-07 06:38:17 -05:00
Andrew Dolgov 36e174750e fix label ordering in feed tree 2021-09-02 08:21:05 +03:00
fox b8f82ca12f Merge pull request 'fix password recovery' (#44) from mechnich/tt-rss:fix-password-recovery into master
Reviewed-on: https://git.tt-rss.org/fox/tt-rss/pulls/44
2021-08-25 19:20:01 +03:00
jmechnich e8f9567d79 fix password recovery 2021-08-25 18:18:04 +02:00
Andrew Dolgov a1173ab06a block useless usort() E_DEPRECATED for the time being 2021-08-23 18:38:37 +03:00
Andrew Dolgov 2c931df77c remove SELF_USER_AGENT custom constant, replaced with configurable Config::HTTP_USER_AGENT / Config::get_user_agent() 2021-08-23 10:56:31 +03:00
Andrew Dolgov 5c60254474 Pref_Feeds:calculate_children_count - fix operator precedence 2021-08-23 10:45:34 +03:00
TonyRL 235ae4ded2 Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (665 of 665 strings)

Translation: Tiny Tiny RSS/messages
Translate-URL: https://weblate.tt-rss.org/projects/tt-rss/messages/zh_Hant/
2021-08-21 16:10:59 +00:00
Andrew Dolgov 0808123179 fix broken feed tree generation when categories are disabled 2021-08-18 21:02:58 +03:00