$methods might be empty, so this needs a `!empty($methods)` check