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
This commit is contained in:
Alexandre Alapetite authored and GitHub committed 2023-04-04 10:23:26 +02:00
1 parent 2340f7a1ba
commit 36aa0122e1
17 files changed
+256 -172

No files matched your search

+1 -19
View File
@@ -6,7 +6,7 @@
* @property array<string|array<int,string>> $db
* @property-read string $disable_update
* @property-read string $environment
* @property-read array<string> $extensions_enabled
* @property array<string,bool> $extensions_enabled
* @property-read string $mailer
* @property-read array<string|int|bool> $smtp
* @property string $title
@@ -91,24 +91,6 @@ class Minz_Configuration {
*/
private $configuration_setter = null;
/**
* List of enabled extensions.
*/
private $extensions_enabled = [];
public function removeExtension($ext_name) {
unset($this->extensions_enabled[$ext_name]);
$legacyKey = array_search($ext_name, $this->extensions_enabled, true);
if ($legacyKey !== false) { //Legacy format FreshRSS < 1.11.1
unset($this->extensions_enabled[$legacyKey]);
}
}
public function addExtension($ext_name) {
if (!isset($this->extensions_enabled[$ext_name])) {
$this->extensions_enabled[$ext_name] = true;
}
}
/**
* Create a new Minz_Configuration object.
*