diff options
| author | 2022-11-15 15:42:26 +0100 | |
|---|---|---|
| committer | 2022-11-15 15:42:26 +0100 | |
| commit | 42eeb402ad574236902e40d35d630fa15d29a985 (patch) | |
| tree | 4eeaedaabcb8ef94b11170f76d55916969b2fe9f /app/Models/SystemConfiguration.php | |
| parent | 07c94061a9607b5d0a1341cc1b349ee094d5115b (diff) | |
Fix type hints regressions (#4855)
Fix regressions from https://github.com/FreshRSS/FreshRSS/pull/4561
Example:
```
PHP Fatal error: Uncaught TypeError: Argument 1 passed to checkToken() must be an instance of FreshRSS_UserConfiguration, instance of Minz_Configuration given, called in /var/www/FreshRSS/p/api/greader.php on line 1091 and defined in /var/www/FreshRSS/p/api/greader.php:223
Stack trace:
#0 /var/www/FreshRSS/p/api/greader.php(1091): checkToken()
#1 {main}
thrown in /var/www/FreshRSS/p/api/greader.php on line 223
```
Improvement of https://github.com/FreshRSS/FreshRSS/pull/4110
Diffstat (limited to 'app/Models/SystemConfiguration.php')
| -rw-r--r-- | app/Models/SystemConfiguration.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/Models/SystemConfiguration.php b/app/Models/SystemConfiguration.php index ec5960c0e..9fc79969d 100644 --- a/app/Models/SystemConfiguration.php +++ b/app/Models/SystemConfiguration.php @@ -25,6 +25,10 @@ * @property string $unsafe_autologin_enabled * @property-read array<string> $trusted_sources */ -class FreshRSS_SystemConfiguration extends Minz_Configuration { +final class FreshRSS_SystemConfiguration extends Minz_Configuration { + public static function init($config_filename, $default_filename = null): FreshRSS_SystemConfiguration { + parent::register('system', $config_filename, $default_filename); + return parent::get('system'); + } } |
