Passed
Push — dev ( e66ec2...f81248 )
by Sergey
12:00 queued 11s
created

ApiController::index()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 38
Code Lines 28

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 28
c 0
b 0
f 0
nc 1
nop 2
dl 0
loc 38
rs 9.472
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Flextype\Plugin\Admin\Controllers;
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
use Flextype\App\Foundation\Container;
0 ignored issues
show
Bug introduced by
The type Flextype\App\Foundation\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...
18
19
class ApiController extends Container
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
28
    {
29
        return $this->twig->render(
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' => 'fas fa-database'
38
                                ],
39
                                'registry' => [
40
                                  'title' => __('admin_registry'),
41
                                  'icon' => 'fas fa-archive'
42
                                ],
43
                                'images' => [
44
                                  'title' => __('admin_images'),
45
                                  'icon' => 'far fa-images'
46
                                ],
47
                                'files' => [
48
                                  'title' => __('admin_files'),
49
                                  'icon' => 'fas fa-file'
50
                                ],
51
                                'folders' => [
52
                                  'title' => __('admin_folders'),
53
                                  'icon' => 'fas fa-folder'
54
                                ],
55
                                'access' => [
56
                                  'title' => __('admin_access'),
57
                                  'icon' => 'fas fa-user-shield'
58
                                ],
59
                               ],
60
                'links' =>  [
61
                    'api' => [
62
                        'link' => $this->router->pathFor('admin.api.index'),
63
                        'title' => __('admin_api'),
64
                        'active' => true,
65
                    ],
66
                ],
67
            ]
68
        );
69
    }
70
}
71