<?php

namespace Plummer\Calendar;

class CalendarFactory
{
	public static function fromRegistry(CalendarAbstract $calendar, RegistryInterface $eventsRegistry, RegistryInterface $recurrencesRegistry)
	{
		return static::fromIterator($calendar, $eventsRegistry->getIterator(), $recurrencesRegistry->getIterator());
	}

	public static function fromIterator(CalendarAbstract $calendar, \Iterator $eventsIterator, \Iterator $recurrencesIterator)
	{
		$calendar->addEventsIterator($eventsIterator);
		$calendar->addRecurrencesIterator($recurrencesIterator);

		return $calendar;
	}
}
<?php

namespace Plummer\Calendar;

class CalendarFactory
{
	public static function fromRegistry(CalendarAbstract $calendar, RegistryInterface $eventsRegistry, RegistryInterface $recurrencesRegistry)
	{
		return static::fromIterator($calendar, $eventsRegistry->getIterator(), $recurrencesRegistry->getIterator());
	}

	public static function fromIterator(CalendarAbstract $calendar, \Iterator $eventsIterator, \Iterator $recurrencesIterator)
	{
		$calendar->addEvents($eventsIterator);
		$calendar->addRecurrenceTypes($recurrencesIterator);

		return $calendar;
	}
}
Correct the add methods being called by the calendar factory.
Correct the add methods being called by the calendar factory.
