Skip to content

Commit

Permalink
fix: type declarations when using VCalendar->VEVENT
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepDiver1975 committed Nov 8, 2023
1 parent 8d45cf0 commit 6805cf2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion tests/VObject/Recur/EventIterator/ByMonthInDailyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use PHPUnit\Framework\TestCase;
use Sabre\VObject\Component\VCalendar;
use Sabre\VObject\Component\VEvent;
use Sabre\VObject\Reader;

class ByMonthInDailyTest extends TestCase
Expand Down Expand Up @@ -42,7 +43,9 @@ public function testExpand(): void
$vcal = $vcal->expand(new \DateTime('2013-09-28'), new \DateTime('2014-09-11'));

$dates = [];
foreach ($vcal->VEVENT as $event) {
/** @var array<int, VEvent> $events */
$events = iterator_to_array($vcal->VEVENT);
foreach ($events as $event) {
$dates[] = $event->DTSTART->getValue();
}

Expand Down
6 changes: 5 additions & 1 deletion tests/VObject/Recur/EventIterator/BySetPosHangTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use PHPUnit\Framework\TestCase;
use Sabre\VObject\Component\VCalendar;
use Sabre\VObject\Component\VEvent;
use Sabre\VObject\Reader;

class BySetPosHangTest extends TestCase
Expand Down Expand Up @@ -37,7 +38,10 @@ public function testExpand(): void
$vcal = $vcal->expand(new \DateTime('2015-01-01'), new \DateTime('2016-01-01'));

$dates = [];
foreach ($vcal->VEVENT as $event) {
/** @var array<int, VEvent> $events */
$events = iterator_to_array($vcal->VEVENT);

foreach ($events as $event) {
$dates[] = $event->DTSTART->getValue();
}

Expand Down
2 changes: 2 additions & 0 deletions tests/VObject/Recur/EventIterator/HandleRDateExpandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use PHPUnit\Framework\TestCase;
use Sabre\VObject\Component\VCalendar;
use Sabre\VObject\Component\VEvent;
use Sabre\VObject\Reader;

/**
Expand Down Expand Up @@ -39,6 +40,7 @@ public function testExpand(): void

$vcal = $vcal->expand(new \DateTime('2015-01-01'), new \DateTime('2015-12-01'));

/** @var array<int, VEvent> $result */
$result = iterator_to_array($vcal->VEVENT);

self::assertCount(5, $result);
Expand Down

0 comments on commit 6805cf2

Please sign in to comment.