ApiController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 28
c 0
b 0
f 0
dl 0
loc 46
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A index() 0 38 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Flextype\Plugin\Admin\Controllers;
6
7
use Flextype\Component\Filesystem\Filesystem;
8
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
19
class ApiController
20
{
21
    /**
22
     * Index page for API's
23
     *
24
     * @param Request  $request  PSR7 request
25
     * @param Response $response PSR7 response
26
     */
27
    public function index(Request $request, Response $response) : Response
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed. ( Ignorable by Annotation )

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

27
    public function index(/** @scrutinizer ignore-unused */ Request $request, Response $response) : Response

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
28
    {
29
        return flextype('twig')->render(
0 ignored issues
show
Bug introduced by
The function flextype 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

29
        return /** @scrutinizer ignore-call */ flextype('twig')->render(
Loading history...
30
            $response,
31
            'plugins/admin/templates/system/api/index.html',
32
            [
33
                'menu_item' => 'api',
34
                'api_list' => [
35
                                'entries' => [
36
                                  'title' => __('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

36
                                  'title' => /** @scrutinizer ignore-call */ __('admin_entries'),
Loading history...
37
                                  'icon' => ['name' => 'database', 'set' => 'fontawesome|solid'],
38
                                ],
39
                                'registry' => [
40
                                  'title' => __('admin_registry'),
41
                                  'icon' => ['name' => 'archive', 'set' => 'fontawesome|solid'],
42
                                ],
43
                                'images' => [
44
                                  'title' => __('admin_images'),
45
                                  'icon' => ['name' => 'images', 'set' => 'fontawesome|solid'],
46
                                ],
47
                                'files' => [
48
                                  'title' => __('admin_files'),
49
                                  'icon' => ['name' => 'file', 'set' => 'fontawesome|solid'],
50
                                ],
51
                                'folders' => [
52
                                  'title' => __('admin_folders'),
53
                                  'icon' => ['name' => 'folder', 'set' => 'fontawesome|solid'],
54
                                ],
55
                                'access' => [
56
                                  'title' => __('admin_access'),
57
                                  'icon' => ['name' => 'user-shield', 'set' => 'fontawesome|solid'],
58
                                ],
59
                               ],
60
                'links' =>  [
61
                    'api' => [
62
                        'link' => flextype('router')->pathFor('admin.api.index'),
63
                        'title' => __('admin_api'),
64
                        'active' => true,
65
                    ],
66
                ],
67
            ]
68
        );
69
    }
70
}
71