From eb7e6b6803ce158bf30dce77b449fcb8b2c3f611 Mon Sep 17 00:00:00 2001 From: Floran Brutel Date: Thu, 19 Apr 2018 09:51:52 +0200 Subject: [PATCH] Ignore path without valid methods --- Describer/SwaggerPhpDescriber.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Describer/SwaggerPhpDescriber.php b/Describer/SwaggerPhpDescriber.php index 608d10b..df670bc 100644 --- a/Describer/SwaggerPhpDescriber.php +++ b/Describer/SwaggerPhpDescriber.php @@ -208,6 +208,10 @@ final class SwaggerPhpDescriber implements ModelRegistryAwareInterface $httpMethods = array_map('strtolower', $httpMethods); $httpMethods = array_intersect($httpMethods, Swagger::$METHODS); + if (empty($httpMethods)) { + continue; + } + yield $method => [$path, $httpMethods]; } }