File tree Expand file tree Collapse file tree 2 files changed +7
-16
lines changed Expand file tree Collapse file tree 2 files changed +7
-16
lines changed Original file line number Diff line number Diff line change @@ -139,19 +139,12 @@ private function hasVisibleItemsOn(string $type): bool
139
139
private function getVisibleItemsOn (string $ type ): array
140
140
{
141
141
return array_filter ($ this ->getItems (), function (IMenuItem $ item ) use ($ type ): bool {
142
- switch ($ type ) {
143
- case 'menu ' :
144
- return $ item ->isVisibleOnMenu ();
145
-
146
- case 'breadcrumbs ' :
147
- return $ item ->isVisibleOnBreadcrumbs ();
148
-
149
- case 'sitemap ' :
150
- return $ item ->isVisibleOnSitemap ();
151
-
152
- default :
153
- return false ;
154
- }
142
+ return match ($ type ) {
143
+ 'menu ' => $ item ->isVisibleOnMenu (),
144
+ 'breadcrumbs ' => $ item ->isVisibleOnBreadcrumbs (),
145
+ 'sitemap ' => $ item ->isVisibleOnSitemap (),
146
+ default => false ,
147
+ };
155
148
});
156
149
}
157
150
Original file line number Diff line number Diff line change @@ -87,9 +87,7 @@ public function isAllowed(): bool
87
87
88
88
public function getActionTarget (): ?string
89
89
{
90
- return $ this ->action !== null
91
- ? $ this ->action ->target
92
- : null ;
90
+ return $ this ->action ?->target;
93
91
}
94
92
95
93
/**
You can’t perform that action at this time.
0 commit comments