Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
BaseView | n/a |
0 / 0 |
n/a |
0 / 0 |
2 | n/a |
0 / 0 |
|||
__construct | n/a |
0 / 0 |
n/a |
0 / 0 |
1 | |||||
render | n/a |
0 / 0 |
n/a |
0 / 0 |
1 |
1 | <?php |
2 | /** |
3 | * Jingga |
4 | * |
5 | * PHP Version 8.1 |
6 | * |
7 | * @package Modules\Admin |
8 | * @copyright Dennis Eichhorn |
9 | * @license OMS License 2.0 |
10 | * @version 1.0.0 |
11 | * @link https://jingga.app |
12 | */ |
13 | declare(strict_types=1); |
14 | |
15 | namespace Modules\Admin\Theme\Backend\Components\AccountPermissionSelector; |
16 | |
17 | use phpOMS\Localization\L11nManager; |
18 | use phpOMS\Message\RequestAbstract; |
19 | use phpOMS\Message\ResponseAbstract; |
20 | use phpOMS\Views\View; |
21 | |
22 | /** |
23 | * Component view. |
24 | * |
25 | * @package Modules\Admin |
26 | * @license OMS License 2.0 |
27 | * @link https://jingga.app |
28 | * @since 1.0.0 |
29 | * @codeCoverageIgnore |
30 | */ |
31 | class BaseView extends View |
32 | { |
33 | /** |
34 | * Form id |
35 | * |
36 | * @var string |
37 | * @since 1.0.0 |
38 | */ |
39 | public string $id = ''; |
40 | |
41 | /** |
42 | * Virtual path of the Admin file |
43 | * |
44 | * @var string |
45 | * @since 1.0.0 |
46 | */ |
47 | public string $virtualPath = ''; |
48 | |
49 | /** |
50 | * Name of the image preview |
51 | * |
52 | * @var string |
53 | * @since 1.0.0 |
54 | */ |
55 | public string $name = ''; |
56 | |
57 | public array $permissions = []; |
58 | |
59 | /** |
60 | * {@inheritdoc} |
61 | */ |
62 | public function __construct(L11nManager $l11n = null, RequestAbstract $request, ResponseAbstract $response) |
63 | { |
64 | parent::__construct($l11n, $request, $response); |
65 | $this->setTemplate('/Modules/Admin/Theme/Backend/Components/AccountPermissionSelector/account-permission-selector'); |
66 | } |
67 | |
68 | /** |
69 | * {@inheritdoc} |
70 | */ |
71 | public function render(mixed ...$data) : string |
72 | { |
73 | /** @var array{0:string, 1?:string, 2?:string} $data */ |
74 | $this->id = $data[0]; |
75 | $this->name = $data[1] ?? 'UNDEFINED'; |
76 | $this->virtualPath = $data[2] ?? $this->virtualPath; |
77 | $this->permissions = $data[3] ?? $this->permissions; |
78 | |
79 | return parent::render(); |
80 | } |
81 | } |