public static function valuesWithType(array $inputArray, string $type): array
    {
        $newArray = [];
        foreach ($inputArray as $key => $value) {
            if (is_scalar($value)) {
                $newValue = $value;
                settype($newValue, $type);
                $newArray[$key] = $newValue;
            }
        }

        return $newArray;
    }