| 
1 | 1 | <?php  | 
 | 2 | + | 
2 | 3 | /**  | 
3 | 4 |  * Create list of dates from recurring rule  | 
4 | 5 |  *  | 
@@ -123,7 +124,6 @@ class ZCRecurringDate  | 
123 | 124 | 	/**  | 
124 | 125 | 	 * start of week number (i.e. 0 for Sunday, 5 for Friday)  | 
125 | 126 | 	 *  | 
126 |  | -	 * @var ?integer  | 
127 | 127 | 	 */  | 
128 | 128 | 	public ?int $weekstart = null;  | 
129 | 129 | 
 
  | 
@@ -550,12 +550,12 @@ public function getDates(?int $maxdate = null) : array  | 
550 | 550 | 				}  | 
551 | 551 | 			}  | 
552 | 552 | 
 
  | 
553 |  | -		if ('u' == $this->repeatmode && $rdates[(\is_countable($rdates) ? \count($rdates) : 0) - 1] > $this->until)  | 
 | 553 | +		if ('u' == $this->repeatmode && $rdates[\count($rdates) - 1] > $this->until)  | 
554 | 554 | 			{  | 
555 | 555 | 			// erase last item  | 
556 | 556 | 			\array_pop($rdates);  | 
557 | 557 | 			}  | 
558 |  | -		$count1 = \is_countable($rdates) ? \count($rdates) : 0;  | 
 | 558 | +		$count1 = \count($rdates);  | 
559 | 559 | 		$rdates = \array_unique($rdates);  | 
560 | 560 | 		$count2 = \count($rdates);  | 
561 | 561 | 		$dups = $count1 - $count2;  | 
@@ -626,7 +626,7 @@ public function setError(string $msg) : self  | 
626 | 626 | 	 *  | 
627 | 627 | 	 * @param int $startdate start date of repeating events, in Unix timestamp format  | 
628 | 628 | 	 * @param int $enddate end date of repeating events, in Unix timestamp format  | 
629 |  | -	 * @param array<int> $rdates array to contain expanded repeating dates  | 
 | 629 | +	 * @param array<int|bool> $rdates array to contain expanded repeating dates  | 
630 | 630 | 	 * @param string $tzid timezone of event (using PHP timezones)  | 
631 | 631 | 	 *  | 
632 | 632 | 	 * @return int count of dates  | 
@@ -750,7 +750,7 @@ private function byDay(int $startdate, int $enddate, array &$rdates, string $tzi  | 
750 | 750 | 	 *  | 
751 | 751 | 	 * @param int $startdate start date of repeating events, in Unix timestamp format  | 
752 | 752 | 	 * @param int $enddate end date of repeating events, in Unix timestamp format  | 
753 |  | -	 * @param array<int> $rdates array to contain expanded repeating dates  | 
 | 753 | +	 * @param array<int|bool> $rdates array to contain expanded repeating dates  | 
754 | 754 | 	 * @param string $tzid timezone of event (using PHP timezones)  | 
755 | 755 | 	 *  | 
756 | 756 | 	 * @return int count of dates  | 
@@ -795,7 +795,7 @@ private function byHour(int $startdate, int $enddate, array &$rdates, string $tz  | 
795 | 795 | 	 *  | 
796 | 796 | 	 * @param int $startdate start date of repeating events, in Unix timestamp format  | 
797 | 797 | 	 * @param int $enddate end date of repeating events, in Unix timestamp format  | 
798 |  | -	 * @param array<int> $rdates array to contain expanded repeating dates  | 
 | 798 | +	 * @param array<int|bool> $rdates array to contain expanded repeating dates  | 
799 | 799 | 	 * @param string $tzid timezone of event (using PHP timezones)  | 
800 | 800 | 	 *  | 
801 | 801 | 	 * @return int count of dates  | 
@@ -839,7 +839,7 @@ private function byMinute(int $startdate, int $enddate, array &$rdates, string $  | 
839 | 839 | 	 *  | 
840 | 840 | 	 * @param int $startdate start date of repeating events, in Unix timestamp format  | 
841 | 841 | 	 * @param int $enddate end date of repeating events, in Unix timestamp format  | 
842 |  | -	 * @param array<int> $rdates array to contain expanded repeating dates  | 
 | 842 | +	 * @param array<int|bool> $rdates array to contain expanded repeating dates  | 
843 | 843 | 	 * @param string $tzid timezone of event (using PHP timezones)  | 
844 | 844 | 	 *  | 
845 | 845 | 	 * @return int count of dates  | 
@@ -883,7 +883,7 @@ private function byMonth(int $startdate, int $enddate, array &$rdates, string $t  | 
883 | 883 | 	 *  | 
884 | 884 | 	 * @param int $startdate start date of repeating events, in Unix timestamp format  | 
885 | 885 | 	 * @param int $enddate end date of repeating events, in Unix timestamp format  | 
886 |  | -	 * @param array<int> $rdates array to contain expanded repeating dates  | 
 | 886 | +	 * @param array<int|bool> $rdates array to contain expanded repeating dates  | 
887 | 887 | 	 * @param string $tzid timezone of event (using PHP timezones)  | 
888 | 888 | 	 *  | 
889 | 889 | 	 * @return int count of dates  | 
@@ -932,7 +932,7 @@ private function byMonthDay(int $startdate, int $enddate, array &$rdates, string  | 
932 | 932 | 	 *  | 
933 | 933 | 	 * @param int $startdate start date of repeating events, in Unix timestamp format  | 
934 | 934 | 	 * @param int $enddate end date of repeating events, in Unix timestamp format  | 
935 |  | -	 * @param array<int> $rdates array to contain expanded repeating dates  | 
 | 935 | +	 * @param array<int|bool> $rdates array to contain expanded repeating dates  | 
936 | 936 | 	 * @param string $tzid timezone of event (using PHP timezones)  | 
937 | 937 | 	 *  | 
938 | 938 | 	 * @return int count of dates  | 
@@ -967,7 +967,7 @@ private function bySecond(int $startdate, int $enddate, array &$rdates, string $  | 
967 | 967 | 	 *  | 
968 | 968 | 	 * @param int $startdate start date of repeating events, in Unix timestamp format  | 
969 | 969 | 	 * @param int $enddate end date of repeating events, in Unix timestamp format  | 
970 |  | -	 * @param array<int> $rdates array to contain expanded repeating dates  | 
 | 970 | +	 * @param array<int|bool> $rdates array to contain expanded repeating dates  | 
971 | 971 | 	 * @param string $tzid timezone of event (using PHP timezones)  | 
972 | 972 | 	 *  | 
973 | 973 | 	 * @return int count of dates  | 
 | 
0 commit comments