aboutsummaryrefslogtreecommitdiff
path: root/lib/core-extensions
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-04-04 10:23:26 +0200
committerGravatar GitHub <noreply@github.com> 2023-04-04 10:23:26 +0200
commit36aa0122e15b6c5a4bf923467b63a577cac5a539 (patch)
tree3dc7d2c5143157165f0248fab7470f86f76b0898 /lib/core-extensions
parent2340f7a1bac38647f0267c1d7143c0cf04d68fcc (diff)
Fix extensions in actualize_script (#5243)
* Fix extension freshrss_user_maintenance in actualize_script Follow-up of https://github.com/FreshRSS/FreshRSS/pull/3440 The hook was called before registering all the extensions for the current user * PHPStan Level 6 for extensions And remove 5-year old legacy format of enabled extensions < FreshRSS 1.11.1 * Fix multiple bugs in extensions * Minor typing * Don't change signature of methods supposed to be overridden * PHPStan Level 9 and compatibility Intelliphense * Set as final the methods not supposed to be overriden
Diffstat (limited to 'lib/core-extensions')
-rw-r--r--lib/core-extensions/Google-Groups/extension.php3
-rw-r--r--lib/core-extensions/Tumblr-GDPR/extension.php3
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/core-extensions/Google-Groups/extension.php b/lib/core-extensions/Google-Groups/extension.php
index 656bf9b8f..cdd605cd9 100644
--- a/lib/core-extensions/Google-Groups/extension.php
+++ b/lib/core-extensions/Google-Groups/extension.php
@@ -1,10 +1,11 @@
<?php
class GoogleGroupsExtension extends Minz_Extension {
+ /** @return void */
public function init() {
$this->registerHook('check_url_before_add', array('GoogleGroupsExtension', 'findFeed'));
}
- public static function findFeed($url) {
+ public static function findFeed(string $url): string {
return preg_replace('%^(https?://groups.google.com/forum)/#!forum/(.+)$%i', '$1/feed/$2/msgs/rss.xml', $url);
}
}
diff --git a/lib/core-extensions/Tumblr-GDPR/extension.php b/lib/core-extensions/Tumblr-GDPR/extension.php
index 83bdf2189..825bb97df 100644
--- a/lib/core-extensions/Tumblr-GDPR/extension.php
+++ b/lib/core-extensions/Tumblr-GDPR/extension.php
@@ -1,11 +1,12 @@
<?php
class TumblrGdprExtension extends Minz_Extension {
+ /** @return void */
public function init() {
$this->registerHook('simplepie_before_init', array('TumblrGdprExtension', 'curlHook'));
}
- public static function curlHook($simplePie, $feed) {
+ public static function curlHook(SimplePie $simplePie, FreshRSS_Feed $feed): void {
if (preg_match('#^https?://[a-zA-Z_0-9-]+.tumblr.com/#i', $feed->url())) {
$simplePie->set_useragent(FRESHRSS_USERAGENT . ' like Baiduspider');
}