Passed
Push — dev ( cc3488...536a25 )
by Sergey
05:38
created

ApiManagementController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
eloc 13
c 1
b 0
f 1
dl 0
loc 25
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A index() 0 17 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Flextype;
6
7
use Flextype\Component\Filesystem\Filesystem;
0 ignored issues
show
Bug introduced by
The type Flextype\Component\Filesystem\Filesystem was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Flextype\Component\Session\Session;
0 ignored issues
show
Bug introduced by
The type Flextype\Component\Session\Session was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use Psr\Http\Message\ResponseInterface as Response;
0 ignored issues
show
Bug introduced by
The type Psr\Http\Message\ResponseInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
use Psr\Http\Message\ServerRequestInterface as Request;
0 ignored issues
show
Bug introduced by
The type Psr\Http\Message\ServerRequestInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Ramsey\Uuid\Uuid;
0 ignored issues
show
Bug introduced by
The type Ramsey\Uuid\Uuid was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
use function bin2hex;
13
use function date;
14
use function Flextype\Component\I18n\__;
0 ignored issues
show
introduced by
The function Flextype\Component\I18n\__ was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
15
use function random_bytes;
16
use function time;
17
18
class ApiManagementController extends Container
0 ignored issues
show
Bug introduced by
The type Flextype\Container was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
19
{
20
    /**
21
     * Management Index page
22
     *
23
     * @param Request  $request  PSR7 request
24
     * @param Response $response PSR7 response
25
     */
26
    public function index(Request $request, Response $response) : Response
27
    {
28
        return $this->twig->render(
29
            $response,
30
            'plugins/admin/templates/system/api/management/index.html',
31
            [
32
                'menu_item' => 'api',
33
                'api_list' => ['entries' => __('admin_entries')],
0 ignored issues
show
Bug introduced by
The function __ was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

33
                'api_list' => ['entries' => /** @scrutinizer ignore-call */ __('admin_entries')],
Loading history...
34
                'links' =>  [
35
                    'api' => [
36
                        'link' => $this->router->pathFor('admin.api.index'),
37
                        'title' => __('admin_api')
38
                    ],
39
                    'api_management' => [
40
                        'link' => $this->router->pathFor('admin.api_management.index'),
41
                        'title' => __('admin_management'),
42
                        'active' => true,
43
                    ],
44
                ],
45
            ]
46
        );
47
    }
48
}
49