capacityMinutes === 0 ? null : $this->bookedMinutes / $this->capacityMinutes; } public function isOverloaded(): bool { return $this->bookedMinutes > $this->capacityMinutes; } /** * Weekdays (Monday to Friday) between the days (Y-m-d, both included) * that are not among the holidays. * * @param list $holidays */ public static function workingDays(string $from, string $to, array $holidays): int { $days = 0; for ($day = new \DateTimeImmutable($from); $day->format('Y-m-d') <= $to; $day = $day->modify('+1 day')) { if ((int) $day->format('N') <= 5 && ! in_array($day->format('Y-m-d'), $holidays, true)) { $days++; } } return $days; } }