22
33namespace InteractionDesignFoundation \WorldClockCard ;
44
5- use Illuminate \Support \Carbon ;
65use Laravel \Nova \Card ;
76
87class WorldClock extends Card
98{
109 /**
1110 * The width of the card (1/3, 1/2, or full).
12- *
1311 * @var string
1412 */
1513 public $ width = '1/3 ' ;
@@ -27,12 +25,12 @@ public function __construct($component = null)
2725 $ this ->withMeta ([
2826 'timezoneDescriptions ' => [],
2927 'nightHours ' => [19 , 6 ],
28+ 'refreshRoute ' => route ('nova.cards.worldClock.refresh ' )
3029 ]);
3130 }
3231
3332 /**
3433 * Get the component name for the element.
35- *
3634 * @return string
3735 */
3836 public function component ()
@@ -41,23 +39,21 @@ public function component()
4139 }
4240
4341 /**
44- * @param array $timezones
42+ * @param list<string> $timezones
4543 * @return $this
4644 */
47- public function timezones (array $ timezones )
45+ public function timezones (array $ timezones ): static
4846 {
4947 return $ this ->withMeta ([
5048 'timezones ' => $ timezones ,
5149 ]);
5250 }
5351
5452 /**
55- * @see https://www.php.net/manual/en/function.date.php
56- *
57- * @param string $timeFormat
53+ * @param string $timeFormat Time, compatiable with date()function, {@see https://www.php.net/manual/en/function.date.php}
5854 * @return $this
5955 */
60- public function timeFormat (string $ timeFormat )
56+ public function timeFormat (string $ timeFormat ): static
6157 {
6258 return $ this ->withMeta ([
6359 'timeFormat ' => $ timeFormat ,
@@ -66,12 +62,11 @@ public function timeFormat(string $timeFormat)
6662
6763 /**
6864 * Specify hours range: when a night starts and ends
69- *
7065 * @param int $nightStart
7166 * @param int $nightEnd
7267 * @return $this
7368 */
74- public function nightRange (int $ nightStart , int $ nightEnd )
69+ public function nightRange (int $ nightStart , int $ nightEnd ): static
7570 {
7671 return $ this ->withMeta ([
7772 'nightHours ' => [$ nightStart , $ nightEnd ],
@@ -84,20 +79,15 @@ public function nightRange(int $nightStart, int $nightEnd)
8479 * @param bool $hideContinents
8580 * @return $this
8681 */
87- public function hideContinents (bool $ hideContinents = true )
82+ public function hideContinents (bool $ hideContinents = true ): static
8883 {
8984 return $ this ->withMeta ([
9085 'hideContinents ' => $ hideContinents ,
9186 ]);
9287 }
9388
94- /**
95- * How often to fetch new data from server
96- *
97- * @param int $ms
98- * @return $this
99- */
100- public function updatePeriod (int $ ms = 1000 )
89+ /** How often to fetch new data from server */
90+ public function updatePeriod (int $ ms = 1000 ): static
10191 {
10292 return $ this ->withMeta ([
10393 'ms ' => $ ms ,
@@ -106,11 +96,10 @@ public function updatePeriod(int $ms = 1000)
10696
10797 /**
10898 * Add text description to timezones. Format: ['tzName' => 'Text description']
109- *
110- * @param array $descriptions
99+ * @param array<string, string> $descriptions
111100 * @return $this
112101 */
113- public function timezoneDescriptions (array $ descriptions )
102+ public function timezoneDescriptions (array $ descriptions ): static
114103 {
115104 return $ this ->withMeta ([
116105 'timezoneDescriptions ' => $ descriptions ,
0 commit comments