public static function validateFormat($format) { $format = strtolower($format); if (!in_array($format, ['php', 'xml', 'yml', 'annotation'])) { throw new \RuntimeException(sprintf('Format "%s" is not supported.', $format)); } return $format; }