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

Introduce Component::setComponents method #124

Merged

Conversation

julienbourdeau
Copy link
Contributor

I'm adding this method because I usually have an array of Events and I just want to pass them all to the calendar, without iterating over the list. It doesn't look like much but I think it keeps my code clearer.

In this method, we lose type safety, but I assume people know what they're doing.

// before
foreach ($events as $event) {
    $calendar->addComponent($event);
}

// after
$calendar->setComponents($events);

src/Component.php Show resolved Hide resolved
src/Component.php Outdated Show resolved Hide resolved
Co-Authored-By: julienbourdeau <julien@sigerr.org>
@markuspoerschke markuspoerschke merged commit 8d69153 into markuspoerschke:master Jan 11, 2019
@julienbourdeau julienbourdeau deleted the feat/setComponents branch January 13, 2019 16:20
@markuspoerschke
Copy link
Owner

Thanks for your contribution! This change will be available in 0.15.0!

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

Successfully merging this pull request may close these issues.

3 participants