ApiDocController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 1
c 3
b 0
f 0
lcom 0
cbo 2
dl 0
loc 15
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A indexAction() 0 7 1
1
<?php
2
3
/*
4
 * This file is part of the Kreta package.
5
 *
6
 * (c) Beñat Espiña <[email protected]>
7
 * (c) Gorka Laucirica <[email protected]>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace Kreta\SimpleApiDocBundle\Controller;
14
15
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
16
use Symfony\Component\HttpFoundation\Response;
17
18
/**
19
 * Api doc controller class.
20
 *
21
 * @author Beñat Espiña <[email protected]>
22
 * @author Gorka Laucirica <[email protected]>
23
 */
24
class ApiDocController extends Controller
25
{
26
    /**
27
     * The index action.
28
     *
29
     * @return Response
30
     */
31
    public function indexAction()
32
    {
33
        $extractedDoc = $this->get('kreta_simple_api_doc.extractor.api_doc_extractor')->all();
34
        $htmlContent = $this->get('nelmio_api_doc.formatter.html_formatter')->format($extractedDoc);
35
36
        return new Response($htmlContent, 200, ['Content-Type' => 'text/html']);
37
    }
38
}
39