11
11
*/
12
12
abstract class Links
13
13
{
14
- public static function event (int $ id ): Url
14
+ public static function event (? int $ id = null ): Url
15
15
{
16
+ if ($ id === null ) {
17
+ return Url::fromPath ('notifications/event ' );
18
+ }
19
+
16
20
return Url::fromPath ('notifications/event ' , ['id ' => $ id ]);
17
21
}
18
22
@@ -26,8 +30,12 @@ public static function incidents(): Url
26
30
return Url::fromPath ('notifications/incidents ' );
27
31
}
28
32
29
- public static function incident (int $ id ): Url
33
+ public static function incident (? int $ id = null ): Url
30
34
{
35
+ if ($ id === null ) {
36
+ return Url::fromPath ('notifications/incident ' );
37
+ }
38
+
31
39
return Url::fromPath ('notifications/incident ' , ['id ' => $ id ]);
32
40
}
33
41
@@ -36,8 +44,12 @@ public static function contacts(): Url
36
44
return Url::fromPath ('notifications/contacts ' );
37
45
}
38
46
39
- public static function contact (int $ id ): Url
47
+ public static function contact (? int $ id = null ): Url
40
48
{
49
+ if ($ id === null ) {
50
+ return Url::fromPath ('notifications/contact ' );
51
+ }
52
+
41
53
return Url::fromPath ('notifications/contact ' , ['id ' => $ id ]);
42
54
}
43
55
@@ -46,8 +58,12 @@ public static function eventRules(): Url
46
58
return Url::fromPath ('notifications/event-rules ' );
47
59
}
48
60
49
- public static function eventRule (int $ id ): Url
61
+ public static function eventRule (? int $ id = null ): Url
50
62
{
63
+ if ($ id === null ) {
64
+ return Url::fromPath ('notifications/event-rule ' );
65
+ }
66
+
51
67
return Url::fromPath ('notifications/event-rule ' , ['id ' => $ id ]);
52
68
}
53
69
@@ -56,8 +72,12 @@ public static function schedules(): Url
56
72
return Url::fromPath ('notifications/schedules ' );
57
73
}
58
74
59
- public static function schedule (int $ id ): Url
75
+ public static function schedule (? int $ id = null ): Url
60
76
{
77
+ if ($ id === null ) {
78
+ return Url::fromPath ('notifications/schedule ' );
79
+ }
80
+
61
81
return Url::fromPath ('notifications/schedule ' , ['id ' => $ id ]);
62
82
}
63
83
@@ -86,8 +106,12 @@ public static function contactGroupsSuggestMember(): Url
86
106
return Url::fromPath ('notifications/contact-groups/suggest-member ' );
87
107
}
88
108
89
- public static function contactGroup (int $ id ): Url
109
+ public static function contactGroup (? int $ id = null ): Url
90
110
{
111
+ if ($ id === null ) {
112
+ return Url::fromPath ('notifications/contact-group ' );
113
+ }
114
+
91
115
return Url::fromPath ('notifications/contact-group ' , ['id ' => $ id ]);
92
116
}
93
117
0 commit comments