Admin::getTagOptions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
eloc 11
c 2
b 0
f 1
dl 0
loc 13
rs 9.9
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace KunicMarko\SonataAnnotationBundle\Annotation;
6
7
use KunicMarko\SonataAnnotationBundle\Admin\AnnotationAdmin;
8
9
/**
10
 * @Annotation
11
 * @Target("CLASS")
12
 *
13
 * @author Marko Kunic <[email protected]>
14
 */
15
final class Admin implements AnnotationInterface
16
{
17
    /**
18
     * @var string
19
     */
20
    public $label;
21
22
    /**
23
     * @var string
24
     */
25
    public $managerType = 'orm';
26
27
    /**
28
     * @var string
29
     */
30
    public $group;
31
32
    /**
33
     * @var bool
34
     */
35
    public $showInDashboard = true;
36
37
    /**
38
     * @var bool
39
     */
40
    public $keepOpen = false;
41
42
    /**
43
     * @var bool
44
     */
45
    public $onTop = false;
46
47
    /**
48
     * @var string
49
     */
50
    public $icon;
51
52
    /**
53
     * @var string
54
     */
55
    public $labelTranslatorStrategy;
56
57
    /**
58
     * @var string
59
     */
60
    public $labelCatalogue;
61
62
    /**
63
     * @var string
64
     */
65
    public $pagerType;
66
67
    /**
68
     * @var string
69
     */
70
    public $controller;
71
72
    /**
73
     * @var string
74
     */
75
    public $serviceId;
76
77
    /**
78
     * @var string
79
     */
80
    public $admin = AnnotationAdmin::class;
81
82
    /**
83
     * @var string
84
     */
85
    public $code;
86
87
    public function getTagOptions(): array
88
    {
89
        return [
90
            'manager_type'              => $this->managerType,
91
            'group'                     => $this->group,
92
            'label'                     => $this->label,
93
            'show_in_dashboard'         => $this->showInDashboard,
94
            'keep_open'                 => $this->keepOpen,
95
            'on_top'                    => $this->onTop,
96
            'icon'                      => $this->icon,
97
            'label_translator_strategy' => $this->labelTranslatorStrategy,
98
            'label_catalogue'           => $this->labelCatalogue,
99
            'pager_type'                => $this->pagerType,
100
        ];
101
    }
102
}
103