Passed
Push — master ( f6e68e...a7b3d9 )
by Fran
03:43
created

ApiController::documentorHome()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 9
nc 1
nop 0
dl 0
loc 12
ccs 0
cts 9
cp 0
crap 2
rs 9.4285
c 1
b 0
f 0
1
<?php
2
namespace PSFS\controller;
3
4
use PSFS\base\Router;
5
use PSFS\base\types\AuthAdminController;
6
7
/**
8
 * Class Api
9
 * @package PSFS\controller
10
 */
11
class ApiController extends AuthAdminController
12
{
13
    const PSFS_DOC = 'psfs';
14
    const SWAGGER_DOC = 'swagger';
15
    const POSTMAN_DOC = 'postman';
16
    const HTML_DOC = 'html';
17
18
    /**
19
     * @Inyectable
20
     * @var \PSFS\services\DocumentorService $srv
21
     */
22
    protected $srv;
23
24
    /**
25
     * @GET
26
     * @route /admin/api/docs
27
     * @label Documentación api
28
     * @return string HTML
0 ignored issues
show
Documentation introduced by
Should the return type not be string|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
29
     */
30
    public function documentorHome() {
31
        $domains = Router::getInstance()->getDomains();
32
        return $this->render('api.home.html.twig', [
33
            'domains' => $domains,
34
            'types' => [
35
                self::PSFS_DOC,
36
                self::SWAGGER_DOC,
37
                self::POSTMAN_DOC,
38
                self::HTML_DOC,
39
            ]
40
        ]);
41
    }
42
}