Code Duplication    Length = 12-13 lines in 3 locations

src/Graviton/CoreBundle/Controller/VersionController.php 2 locations

@@ 76-88 (lines=13) @@
73
     *
74
     * @return \Symfony\Component\HttpFoundation\Response $response Response with result or error
75
     */
76
    public function versionsAction()
77
    {
78
        $response = $this->getResponse()
79
            ->setStatusCode(Response::HTTP_OK);
80
        $response->headers->set('Content-Type', 'application/json');
81
        $versions = array();
82
        $versions['versions'] = $this->coreUtils->getVersion();
83
        return $this->render(
84
            'GravitonRestBundle:Main:index.json.twig',
85
            ['response' => json_encode($versions)],
86
            $response
87
        );
88
    }
89
90
    /**
91
     * Returns schema
@@ 95-106 (lines=12) @@
92
     *
93
     * @return \Symfony\Component\HttpFoundation\Response $response Response with result or error
94
     */
95
    public function versionsSchemaAction()
96
    {
97
        $response = $this->getResponse()
98
            ->setStatusCode(Response::HTTP_OK);
99
        $response->headers->set('Content-Type', 'application/json');
100
        $schema = $this->getModel()->getSchema();
101
        return $this->render(
102
            'GravitonRestBundle:Main:index.json.twig',
103
            ['response' => json_encode($schema)],
104
            $response
105
        );
106
    }
107
}
108

src/Graviton/SecurityBundle/Controller/WhoAmIController.php 1 location

@@ 100-112 (lines=13) @@
97
     *
98
     * @return Response $response Response with result or error
99
     */
100
    public function whoAmiSchemaAction()
101
    {
102
        /** @var Response $response */
103
        $response = $this->getResponse();
104
        $response->headers->set('Content-Type', 'application/json');
105
106
        $schema = $this->getModel()->getSchema();
107
        return $this->render(
108
            'GravitonRestBundle:Main:index.json.twig',
109
            ['response' => json_encode($schema)],
110
            $response
111
        );
112
    }
113
}
114