public function process()
    {
        $reader = new AnnotationReader();

        $paths = array();
        /* @var Route $route */
        foreach ($this->routeCollection->getIterator() as $route) {
            $routeMethod = $this->getReflectionMethodForRoute($route);
            if($routeMethod === null) continue;

            /** @var Swagger $swaggerAnnotation */
            $swaggerAnnotation = $reader->getMethodAnnotation($routeMethod, Swagger::class);
            if ($swaggerAnnotation === null || $swaggerAnnotation->showInDocs === false) continue;

            $path = explode('.', $route->getPath())[0];
            if (!isset($paths[$path])) $paths[$path] = array();

            // Prepare the data for the route.
            $allAnnotations = $reader->getMethodAnnotations($routeMethod);
            $routeData = array(
                "operationId" => $this->getOperationId($swaggerAnnotation, $this->extractControllerDefaultFromRoute($route)),
                "summary" => $swaggerAnnotation->description,
                "produces" => $swaggerAnnotation->produces,
                "consumes" => $swaggerAnnotation->consumes,
                "responses" => $this->createResponsesForRoute($allAnnotations),
                "parameters" => $this->createParametersForRoute($route, $allAnnotations),
            );

            if ($swaggerAnnotation->tags !== null) {
                $routeData["tags"] = $swaggerAnnotation->tags;
            }


            // Set the data for each method. Needed for when a route can handle multiple methods.
            foreach ($route->getMethods() as $method) {
                $paths[$path][strtolower($method)] = $routeData;
            }
        }

        return $paths;
    }
public function process()
    {
        $reader = new AnnotationReader();

        $paths = array();
        /* @var Route $route */
        foreach ($this->routeCollection->getIterator() as $route) {
            $routeMethod = $this->getReflectionMethodForRoute($route);
            if($routeMethod === null) continue;

            /** @var Swagger $swaggerAnnotation */
            $swaggerAnnotation = $reader->getMethodAnnotation($routeMethod, Swagger::class);
            if ($swaggerAnnotation === null || $swaggerAnnotation->showInDocs === false) continue;

            $path = explode('.', $route->getPath())[0];
            if (!isset($paths[$path])) $paths[$path] = array();

            // Prepare the data for the route.
            $allAnnotations = $reader->getMethodAnnotations($routeMethod);
            $routeData = array(
                "operationId" => $this->getOperationId($swaggerAnnotation, $this->extractControllerDefaultFromRoute($route)),
                "summary" => $swaggerAnnotation->description,
                "produces" => $swaggerAnnotation->produces,
                "consumes" => $swaggerAnnotation->consumes,
                "responses" => $this->createResponsesForRoute($allAnnotations),
                "parameters" => $this->createParametersForRoute($route, $allAnnotations),
            );

            if ($swaggerAnnotation->tags !== null) {
                $routeData["tags"] = $swaggerAnnotation->tags;
            }


            // Set the data for each method. Needed for when a route can handle multiple methods.
            foreach ($route->getMethods() as $method) {
                $paths[$path][strtolower($method)] = $routeData;
            }
        }

        return $paths;
    }
public function process ( ) { $ reader = new AnnotationReader ( ) ; $ paths = array ( ) ; /* @var Route $route */ foreach ( $ this -> routeCollection -> getIterator ( ) as $ route ) { $ routeMethod = $ this -> getReflectionMethodForRoute ( $ route ) ; if ( $ routeMethod === null ) continue ; /** @var Swagger $swaggerAnnotation */ $ swaggerAnnotation = $ reader -> getMethodAnnotation ( $ routeMethod , Swagger :: class ) ; if ( $ swaggerAnnotation === null || $ swaggerAnnotation -> showInDocs === false ) continue ; $ path = explode ( '.' , $ route -> getPath ( ) ) [ 0 ] ; if ( ! isset ( $ paths [ $ path ] ) ) $ paths [ $ path ] = array ( ) ; // Prepare the data for the route. $ allAnnotations = $ reader -> getMethodAnnotations ( $ routeMethod ) ; $ routeData = array ( "operationId" => $ this -> getOperationId ( $ swaggerAnnotation , $ this -> extractControllerDefaultFromRoute ( $ route ) ) , "summary" => $ swaggerAnnotation -> description , "produces" => $ swaggerAnnotation -> produces , "consumes" => $ swaggerAnnotation -> consumes , "responses" => $ this -> createResponsesForRoute ( $ allAnnotations ) , "parameters" => $ this -> createParametersForRoute ( $ route , $ allAnnotations ) , ) ; if ( $ swaggerAnnotation -> tags !== null ) { $ routeData [ "tags" ] = $ swaggerAnnotation -> tags ; } // Set the data for each method. Needed for when a route can handle multiple methods. foreach ( $ route -> getMethods ( ) as $ method ) { $ paths [ $ path ] [ strtolower ( $ method ) ] = $ routeData ; } } return $ paths ; }
Processes all the routes in the application to build the swagger json. Generates an array containing all the paths.

@return array Contains all the paths as keys, the data as value
Processes all the routes in the application to build the swagger json . Generates an array containing all the paths .