mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-10 10:02:33 +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,
|
array $working_plan_exception = null,
|
||||||
): void {
|
): void {
|
||||||
// Validate the working plan exception data.
|
// 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']));
|
$start = date('H:i', strtotime($working_plan_exception['start']));
|
||||||
|
|
||||||
$end = date('H:i', strtotime($working_plan_exception['end']));
|
$end = date('H:i', strtotime($working_plan_exception['end']));
|
||||||
|
|
Loading…
Reference in a new issue