From f1717a857ae04c0b5bd3e141749723b717556dc6 Mon Sep 17 00:00:00 2001 From: Johannes Przymusinski Date: Fri, 11 Feb 2022 22:36:43 +0100 Subject: [PATCH] bugfix(conf): add braces around property access --- Classes/Domain/Configuration/Configuration.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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; } } }