Skip to content

Commit 09cdc12

Browse files
committed
PHP 7.4 Rector
1 parent 367e893 commit 09cdc12

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/ICalendarOrg/ZCRecurringDate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,12 +557,12 @@ public function getDates(?int $maxdate = null) : array
557557
}
558558
}
559559

560-
if ('u' == $this->repeatmode && $rdates[\count($rdates) - 1] > $this->until)
560+
if ('u' == $this->repeatmode && $rdates[(\is_countable($rdates) ? \count($rdates) : 0) - 1] > $this->until)
561561
{
562562
// erase last item
563563
\array_pop($rdates);
564564
}
565-
$count1 = \count($rdates);
565+
$count1 = \is_countable($rdates) ? \count($rdates) : 0;
566566
$rdates = \array_unique($rdates);
567567
$count2 = \count($rdates);
568568
$dups = $count1 - $count2;

src/ICalendarOrg/ZCiCal.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class ZCiCal
3636
*
3737
* @throws \Exception
3838
*/
39-
public function __construct(string $data = '', int $maxevents = 1000000, int $startevent = 0)
39+
public function __construct(string $data = '', int $maxevents = 1_000_000, int $startevent = 0)
4040
{
4141

4242
if ('' != $data)
@@ -288,7 +288,7 @@ public static function formatContent(string $content) : string
288288
*/
289289
public function getFirstChild($thisnode) : ?object
290290
{
291-
if (\count($thisnode->child) > 0)
291+
if ((\is_countable($thisnode->child) ? \count($thisnode->child) : 0) > 0)
292292
{
293293
return $thisnode->child[0];
294294
}

0 commit comments

Comments
 (0)