| Total Complexity | 1 |
| Total Lines | 18 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class Navigation |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * Configuration helper method to define a new navigation item, with better IDE support. |
||
| 16 | * |
||
| 17 | * The returned array will then be used by the framework to create a new NavigationItem instance. {@see \Hyde\Framework\Features\Navigation\NavigationItem} |
||
| 18 | * |
||
| 19 | * @see https://hydephp.com/docs/2.x/navigation-api |
||
| 20 | * |
||
| 21 | * @param string<\Hyde\Support\Models\RouteKey>|string $destination Route key, or an external URI. |
||
| 22 | * @param string|null $label If not provided, Hyde will try to get it from the route's connected page, or from the URL. |
||
| 23 | * @param int|null $priority If not provided, Hyde will try to get it from the route or the default priority of 500. |
||
| 24 | * @param array<string, scalar> $attributes Additional attributes for the navigation item. |
||
| 25 | * @return array{destination: string, label: ?string, priority: ?int, attributes: array<string, scalar>} |
||
| 26 | */ |
||
| 27 | public static function item(string $destination, ?string $label = null, ?int $priority = null, array $attributes = []): array |
||
| 32 |