diff --git a/Classes/Domain/Configuration/Configuration.php b/Classes/Domain/Configuration/Configuration.php index 5ad414d..2254055 100644 --- a/Classes/Domain/Configuration/Configuration.php +++ b/Classes/Domain/Configuration/Configuration.php @@ -37,7 +37,7 @@ public function __construct( foreach ($configuration as $key => $value) { if (property_exists(__CLASS__, $key) && $value !== "") { - $this->$key = $value; + $this->{$key} = $value; } } } catch (Exception $exception) { @@ -64,7 +64,11 @@ private function populateWithEnvironmentVariables(): void foreach ($envMapping as $conf) { $value = getenv($conf[1]); if ($value) { - $this->$conf[0] = $value; + $type = gettype($this->{$conf[0]}); + settype($value, $type); + // FIXME: Remove comment when phpstan has proper support for \settype(); + // @phpstan-ignore-next-line + $this->{$conf[0]} = $value; } } }