private function determineType($type, $keyType = false)
{
if (!$keyType && $this->nonScalarTypeExists($type)) {
return $type;
}
if ($scalarType = $this->determineScalar($type)) {
if ($keyType && in_array($scalarType, ["double", "boolean"])) {
throw new InvalidArgumentException("This type is not supported as a key.");
}
return $scalarType;
}
throw new InvalidArgumentException("This type does not exist.");
}