summaryrefslogtreecommitdiff
path: root/classes/config.php
diff options
context:
space:
mode:
authorfox <[email protected]>2021-11-02 08:37:11 +0300
committerfox <[email protected]>2021-11-02 08:37:11 +0300
commit7a52560e4e3b0652d32645b60ae13e4904f606bc (patch)
tree42b5748e6fc518a48adf52ec97a2f084acbfd036 /classes/config.php
parent9714c4fbcf76492d084ca5327cbab1ad1b662280 (diff)
parent57436ee0c184c5fa362c66f8383a8a3b29f171cf (diff)
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
Diffstat (limited to 'classes/config.php')
-rw-r--r--classes/config.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/classes/config.php b/classes/config.php
index be4ecde36..53a31b61c 100644
--- a/classes/config.php
+++ b/classes/config.php
@@ -234,10 +234,9 @@ class Config {
private static $instance;
private $params = [];
- private $schema_version = null;
private $version = [];
- /** @var Db_Migrations $migrations */
+ /** @var Db_Migrations|null $migrations */
private $migrations;
public static function get_instance() : Config {
@@ -255,10 +254,10 @@ class Config {
$ref = new ReflectionClass(get_class($this));
foreach ($ref->getConstants() as $const => $cvalue) {
- if (isset($this::_DEFAULTS[$const])) {
- $override = getenv($this::_ENVVAR_PREFIX . $const);
+ if (isset(self::_DEFAULTS[$const])) {
+ $override = getenv(self::_ENVVAR_PREFIX . $const);
- list ($defval, $deftype) = $this::_DEFAULTS[$const];
+ list ($defval, $deftype) = self::_DEFAULTS[$const];
$this->params[$cvalue] = [ self::cast_to($override !== false ? $override : $defval, $deftype), $deftype ];
}
@@ -383,7 +382,7 @@ class Config {
}
private function _add(string $param, string $default, int $type_hint) {
- $override = getenv($this::_ENVVAR_PREFIX . $param);
+ $override = getenv(self::_ENVVAR_PREFIX . $param);
$this->params[$param] = [ self::cast_to($override !== false ? $override : $default, $type_hint), $type_hint ];
}