private static function validateBool($key, $value)
    {
        $value = filter_var($value, FILTER_VALIDATE_BOOLEAN, [
            'flags' => FILTER_NULL_ON_FAILURE,
        ]);
        if ($value === null) {
            throw new \InvalidArgumentException("Option[$key] must be boolean.");
        }
        return $value;
    }