diff --git a/composer.json b/composer.json index 273cbc8..a36b88a 100644 --- a/composer.json +++ b/composer.json @@ -12,6 +12,9 @@ "minimum-stability": "dev", "prefer-stable": true, "config": { + "platform": { + "php": "7.4.0" + }, "optimize-autoloader": true, "sort-packages": true }, diff --git a/src/Option.php b/src/Option.php index 0c347d2..f65895f 100644 --- a/src/Option.php +++ b/src/Option.php @@ -244,7 +244,8 @@ public function isType($type) public function getTypeClass() { - $class = 'GetOptionKit\\ValueType\\'.ucfirst($this->isa).'Type'; + $isa = (string) $this->isa; + $class = 'GetOptionKit\\ValueType\\'.ucfirst($isa).'Type'; if (class_exists($class, true)) { return new $class($this->isaOption); } @@ -261,7 +262,9 @@ protected function _preprocessValue($value) { $val = $value; - if ($isa = ucfirst((string) $this->isa)) { + $isa = (string) $this->isa; + if ($isa !== '') { + $isa = ucfirst($isa); $type = $this->getTypeClass(); if ($type->test($value)) { $val = $type->parse($value);