mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-28 10:53:40 +03:00
Add empty value check (#1529)
This commit is contained in:
parent
3f39861e4a
commit
7713f3ffa6
1 changed files with 7 additions and 0 deletions
|
@ -524,6 +524,13 @@ class Providers_model extends EA_Model
|
|||
array $working_plan_exception = null,
|
||||
): void {
|
||||
// Validate the working plan exception data.
|
||||
|
||||
if (empty($working_plan_exception['start']) || empty($working_plan_exception['end'])) {
|
||||
throw new InvalidArgumentException(
|
||||
'Empty start and/or end time provided: ' . json_encode($working_plan_exception),
|
||||
);
|
||||
}
|
||||
|
||||
$start = date('H:i', strtotime($working_plan_exception['start']));
|
||||
|
||||
$end = date('H:i', strtotime($working_plan_exception['end']));
|
||||
|
|
Loading…
Reference in a new issue