On the holiday collection, now we use strings to compare if a date is a holiday, we should implement a DateTime collection instance to set the holidays and compare objects not strings. I think we should do that in the new method "isBetween".
What do you think about it @marcelsud ?
From:
/**
* Set Holidays
* @param array $holidays
*/
public function setHolidays($holidays)
{
$this->holidays = $holidays;
}
To:
/**
* Set Holidays
* @param DateTimeCollection $holidays
*/
public function setHolidays(DateTimeCollection $holidays)
{
$this->holidays = $holidays;
}
Or we could use a Dependency Injection on the DateTime Class
/**
* Construct Method
* @param string $time
* @param DateTimeZone $timezone
* @param DateTimeCollection $holidays
*/
public function __construct(string $time, DateTimeZone $timezone = null, DateTimeCollection $holidays = null)
{
parent::__construct($time, $timezone);
$this->holidays = $holidays;
}
On the holiday collection, now we use strings to compare if a date is a holiday, we should implement a DateTime collection instance to set the holidays and compare objects not strings. I think we should do that in the new method "isBetween".
What do you think about it @marcelsud ?
From:
To:
Or we could use a Dependency Injection on the DateTime Class