Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong parameter #281

Closed
garak opened this issue May 26, 2021 · 1 comment · Fixed by #329
Closed

Wrong parameter #281

garak opened this issue May 26, 2021 · 1 comment · Fixed by #329
Assignees
Labels
Milestone

Comments

@garak
Copy link

garak commented May 26, 2021

My code:

$event = (new Event())
    ->setSummary('Foo')
    ->setDescription('Bar')
    ->setOccurrence(new SingleDay(new Date($myDateTime)))
;
$component = $this->calendarFactory->createCalendar(new Calendar([$event]));

when inspecting with phpstan, I get the following error (on last line):

Parameter #1 $events of class Eluceo\iCal\Domain\Entity\Calendar constructor expects
(Eluceo\iCal\Domain\Collection\Events&iterable<Eluceo\iCal\Domain\Entity\Event>)|(iterable<Eluceo\iCal\Domain\Entity\Event>&Iterator<mixed, Eluceo\iCal\Domain\Entity\Event>),
array<int, Eluceo\iCal\Domain\Entity\Event> given.

@markuspoerschke
Copy link
Owner

Thanks for pointing this out. It was wrong indeed.

Be aware, that you might have to adopt your PHPStan config, once you update, because the muted error must be removed. Otherwise PHPStan might complain about a muted error that was never thrown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants