diff --git a/src/EnvReader/GenericConfig.php b/src/EnvReader/GenericConfig.php index f900c54..bedc510 100644 --- a/src/EnvReader/GenericConfig.php +++ b/src/EnvReader/GenericConfig.php @@ -110,7 +110,7 @@ abstract class GenericConfig { */ public function getPropertyAsString (string $name, ?string $default = null): string { $value = $this->getProperty($name, $default); - if (!is_string($value) || !is_object($value) || method_exists($value, '__ToString')) { + if (!is_string($value) && !is_object($value) && !method_exists($value, '__ToString')) { throw new RangeException('The "' . $name . '" property is not a valid string : ' . $value); }