public static function throwIfNotType(
        array $typesToVariables,
        bool $failOnWhitespace = false,
        bool $allowNulls = false
    ) {
        foreach ($typesToVariables as $type => $variablesOrVariable) {
            self::handleTypesToVariables($failOnWhitespace, $allowNulls, $variablesOrVariable, $type);
        }
    }
public static function throwIfNotType(
        array $typesToVariables,
        bool $failOnWhitespace = false,
        bool $allowNulls = false
    ) {
        foreach ($typesToVariables as $type => $variablesOrVariable) {
            self::handleTypesToVariables($failOnWhitespace, $allowNulls, $variablesOrVariable, $type);
        }
    }
public static function throwIfNotType ( array $ typesToVariables , bool $ failOnWhitespace = false , bool $ allowNulls = false ) { foreach ( $ typesToVariables as $ type => $ variablesOrVariable ) { self :: handleTypesToVariables ( $ failOnWhitespace , $ allowNulls , $ variablesOrVariable , $ type ) ; } }
Throws an exception if specified variables are not of given types.

@param array $typesToVariables like ['string' => [$var1, $var2], 'int' => [$var1, $var2]] or
['string' => $var1, 'integer' => [1, $var2]]. Supported types are the suffixes
of the is_* functions such as string for is_string and int for is_int
@param bool  $failOnWhitespace whether to fail strings if they are whitespace
@param bool  $allowNulls       whether to allow null values to pass through

@return void

@throws InvalidArgumentException if a key in $typesToVariables was not a string
@throws InvalidArgumentException if a key in $typesToVariables did not have an is_ function
@throws InvalidArgumentException if a variable is not of correct type
@throws InvalidArgumentException if a variable is whitespace and $failOnWhitespace is set
Throws an exception if specified variables are not of given types .