File tree 6 files changed +24
-16
lines changed
6 files changed +24
-16
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,8 @@ class Checkbox extends MenuItem
7
7
protected string $ type = 'checkbox ' ;
8
8
9
9
public function __construct (
10
- string $ label ,
10
+ protected ? string $ label ,
11
11
protected bool $ isChecked = false ,
12
12
protected ?string $ accelerator = null
13
- ) {
14
- $ this ->label = $ label ;
15
- }
13
+ ) {}
16
14
}
Original file line number Diff line number Diff line change 4
4
5
5
class Label extends MenuItem
6
6
{
7
- public function __construct (string $ label )
8
- {
9
- $ this -> label = $ label ;
10
- }
7
+ public function __construct (
8
+ protected ? string $ label ,
9
+ protected ? string $ accelerator = null
10
+ ) { }
11
11
}
Original file line number Diff line number Diff line change @@ -8,7 +8,11 @@ class Link extends MenuItem
8
8
9
9
protected bool $ openInBrowser = false ;
10
10
11
- public function __construct (protected string $ url , protected ?string $ label , protected ?string $ accelerator = null ) {}
11
+ public function __construct (
12
+ protected string $ url ,
13
+ protected ?string $ label ,
14
+ protected ?string $ accelerator = null
15
+ ) {}
12
16
13
17
public function openInBrowser (bool $ openInBrowser = true ): self
14
18
{
Original file line number Diff line number Diff line change @@ -7,10 +7,8 @@ class Radio extends MenuItem
7
7
protected string $ type = 'radio ' ;
8
8
9
9
public function __construct (
10
- string $ label ,
10
+ protected ? string $ label ,
11
11
protected bool $ isChecked = false ,
12
12
protected ?string $ accelerator = null
13
- ) {
14
- $ this ->label = $ label ;
15
- }
13
+ ) {}
16
14
}
Original file line number Diff line number Diff line change @@ -8,7 +8,10 @@ class Role extends MenuItem
8
8
{
9
9
protected string $ type = 'role ' ;
10
10
11
- public function __construct (protected RolesEnum $ role , protected ?string $ label = '' ) {}
11
+ public function __construct (
12
+ protected RolesEnum $ role ,
13
+ protected ?string $ label = ''
14
+ ) {}
12
15
13
16
public function toArray (): array
14
17
{
Original file line number Diff line number Diff line change @@ -38,9 +38,9 @@ public function default(): void
38
38
);
39
39
}
40
40
41
- public function label (string $ label ): Items \Label
41
+ public function label (string $ label, ? string $ hotkey = null ): Items \Label
42
42
{
43
- return new Items \Label ($ label );
43
+ return new Items \Label ($ label, $ hotkey );
44
44
}
45
45
46
46
public function checkbox (string $ label , bool $ checked = false , ?string $ hotkey = null ): Items \Checkbox
@@ -162,4 +162,9 @@ public function hide(?string $label = null): Items\Role
162
162
{
163
163
return new Items \Role (RolesEnum::HIDE , $ label );
164
164
}
165
+
166
+ public function about (?string $ label = null ): Items \Role
167
+ {
168
+ return new Items \Role (RolesEnum::ABOUT , $ label );
169
+ }
165
170
}
You can’t perform that action at this time.
0 commit comments