protected function validate(array $options)
{
if (!isset($options['method'])) {
throw new \InvalidArgumentException('method property is missing');
} elseif (!in_array($options['method'], ['GET', 'POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE', 'HEAD'])) {
throw new \InvalidArgumentException('method property is not valid');
} elseif (!isset($options['path'])) {
throw new \InvalidArgumentException('path property is missing');
} elseif (isset($options['since']) && !preg_match('#^' . Application::API_VERSION_REG_EXP . '$#', $options['since'])) {
throw new \InvalidArgumentException('since property is not valid');
} elseif (isset($options['until']) && !preg_match('#^' . Application::API_VERSION_REG_EXP . '$#', $options['until'])) {
throw new \InvalidArgumentException('until property is not valid');
}
}