diff options
| author | 2022-11-15 15:42:26 +0100 | |
|---|---|---|
| committer | 2022-11-15 15:42:26 +0100 | |
| commit | 42eeb402ad574236902e40d35d630fa15d29a985 (patch) | |
| tree | 4eeaedaabcb8ef94b11170f76d55916969b2fe9f /lib | |
| 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 'lib')
| -rw-r--r-- | lib/Minz/Configuration.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Minz/Configuration.php b/lib/Minz/Configuration.php index 403d6ccba..6d4aed0ab 100644 --- a/lib/Minz/Configuration.php +++ b/lib/Minz/Configuration.php @@ -26,7 +26,7 @@ class Minz_Configuration { * @param object $configuration_setter an optional helper to set values in configuration */ public static function register($namespace, $config_filename, $default_filename = null, $configuration_setter = null) { - self::$config_list[$namespace] = new Minz_Configuration( + self::$config_list[$namespace] = new static( $namespace, $config_filename, $default_filename, $configuration_setter ); } @@ -51,7 +51,7 @@ class Minz_Configuration { * Return the configuration related to a given namespace. * * @param string $namespace the name of the configuration to get. - * @return Minz_Configuration object + * @return static object * @throws Minz_ConfigurationNamespaceException if the namespace does not exist. */ public static function get($namespace) { @@ -117,7 +117,7 @@ class Minz_Configuration { * @param string $default_filename the file containing default values, null by default. * @param object $configuration_setter an optional helper to set values in configuration */ - private function __construct($namespace, $config_filename, $default_filename = null, $configuration_setter = null) { + private final function __construct($namespace, $config_filename, $default_filename = null, $configuration_setter = null) { $this->namespace = $namespace; $this->config_filename = $config_filename; $this->default_filename = $default_filename; |
