@@ -206,17 +206,7 @@ check_fit_info <- function(fit_obj) {
206206 call. = FALSE )
207207 }
208208
209- exp_interf <- c(" data.frame" , " formula" , " matrix" )
210- if (length(fit_obj $ interface ) != 1 ) {
211- stop(" The `interface` element should have a single value of : " ,
212- paste0(" `" , exp_interf , " `" , collapse = " , " ),
213- call. = FALSE )
214- }
215- if (! fit_obj $ interface %in% exp_interf ) {
216- stop(" The `interface` element should have a value of : " ,
217- paste0(" `" , exp_interf , " `" , collapse = " , " ),
218- call. = FALSE )
219- }
209+ check_interface_val(fit_obj $ interface )
220210 check_func_val(fit_obj $ func )
221211
222212 if (! is.list(fit_obj $ defaults )) {
@@ -265,6 +255,17 @@ check_pkg_val <- function(pkg) {
265255 invisible (NULL )
266256}
267257
258+ check_interface_val <- function (x ) {
259+ exp_interf <- c(" data.frame" , " formula" , " matrix" )
260+ if (length(x ) != 1 || ! (x %in% exp_interf )) {
261+ stop(" The `interface` element should have a single value of : " ,
262+ paste0(" `" , exp_interf , " `" , collapse = " , " ),
263+ call. = FALSE )
264+ }
265+ invisible (NULL )
266+ }
267+
268+
268269# ------------------------------------------------------------------------------
269270
270271# ' @rdname get_model_env
0 commit comments