Skip to content

Commit d2d86eb

Browse files
committed
Update PHPStan
1 parent a33c3a0 commit d2d86eb

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"require-dev": {
3737
"phpunit/phpunit": "<12.0",
3838
"friendsofphp/php-cs-fixer": "^3.3",
39-
"phpstan/phpstan": "^1.8",
39+
"phpstan/phpstan": "^2.0",
4040
"phpfui/phpunit-syntax-coverage": "dev-master"
4141
}
4242
}

src/ICalendarOrg/ZCRecurringDate.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* Create list of dates from recurring rule
45
*
@@ -123,7 +124,6 @@ class ZCRecurringDate
123124
/**
124125
* start of week number (i.e. 0 for Sunday, 5 for Friday)
125126
*
126-
* @var ?integer
127127
*/
128128
public ?int $weekstart = null;
129129

@@ -550,12 +550,12 @@ public function getDates(?int $maxdate = null) : array
550550
}
551551
}
552552

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)
554554
{
555555
// erase last item
556556
\array_pop($rdates);
557557
}
558-
$count1 = \is_countable($rdates) ? \count($rdates) : 0;
558+
$count1 = \count($rdates);
559559
$rdates = \array_unique($rdates);
560560
$count2 = \count($rdates);
561561
$dups = $count1 - $count2;
@@ -626,7 +626,7 @@ public function setError(string $msg) : self
626626
*
627627
* @param int $startdate start date of repeating events, in Unix timestamp format
628628
* @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
630630
* @param string $tzid timezone of event (using PHP timezones)
631631
*
632632
* @return int count of dates
@@ -750,7 +750,7 @@ private function byDay(int $startdate, int $enddate, array &$rdates, string $tzi
750750
*
751751
* @param int $startdate start date of repeating events, in Unix timestamp format
752752
* @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
754754
* @param string $tzid timezone of event (using PHP timezones)
755755
*
756756
* @return int count of dates
@@ -795,7 +795,7 @@ private function byHour(int $startdate, int $enddate, array &$rdates, string $tz
795795
*
796796
* @param int $startdate start date of repeating events, in Unix timestamp format
797797
* @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
799799
* @param string $tzid timezone of event (using PHP timezones)
800800
*
801801
* @return int count of dates
@@ -839,7 +839,7 @@ private function byMinute(int $startdate, int $enddate, array &$rdates, string $
839839
*
840840
* @param int $startdate start date of repeating events, in Unix timestamp format
841841
* @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
843843
* @param string $tzid timezone of event (using PHP timezones)
844844
*
845845
* @return int count of dates
@@ -883,7 +883,7 @@ private function byMonth(int $startdate, int $enddate, array &$rdates, string $t
883883
*
884884
* @param int $startdate start date of repeating events, in Unix timestamp format
885885
* @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
887887
* @param string $tzid timezone of event (using PHP timezones)
888888
*
889889
* @return int count of dates
@@ -932,7 +932,7 @@ private function byMonthDay(int $startdate, int $enddate, array &$rdates, string
932932
*
933933
* @param int $startdate start date of repeating events, in Unix timestamp format
934934
* @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
936936
* @param string $tzid timezone of event (using PHP timezones)
937937
*
938938
* @return int count of dates
@@ -967,7 +967,7 @@ private function bySecond(int $startdate, int $enddate, array &$rdates, string $
967967
*
968968
* @param int $startdate start date of repeating events, in Unix timestamp format
969969
* @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
971971
* @param string $tzid timezone of event (using PHP timezones)
972972
*
973973
* @return int count of dates

0 commit comments

Comments
 (0)