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

ApiController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 32
ccs 0
cts 9
cp 0
rs 10
c 1
b 0
f 0
wmc 1
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A documentorHome() 0 12 1
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
}