Skip to content

Commit

Permalink
Fix throwing not supported exceptions from opening hours entity
Browse files Browse the repository at this point in the history
  • Loading branch information
firstred committed Jun 16, 2021
1 parent 03420ba commit c752a52
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Entity/OpeningHours.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public static function jsonDeserialize(stdClass $json)
} elseif (is_array($item)) {
$openingHours->$day = array_merge($openingHours->$day, $item);
} else {
throw new NotSupportedException('Unable to parse opening hours', 0, $json->OpeningHours->$day);
throw new NotSupportedException('Unable to parse opening hours');
}
}
} elseif (isset($json->OpeningHours->$day->string)) {
Expand All @@ -227,7 +227,7 @@ public static function jsonDeserialize(stdClass $json)

foreach ($openingHours->$day as &$time) {
if (!is_string($time)) {
throw new NotSupportedException('Unable to parse opening hours', 0, $openingHours->$day);
throw new NotSupportedException('Unable to parse opening hours');
}
$timeParts = explode('-', $time);
if (2 !== count($timeParts)) {
Expand Down

0 comments on commit c752a52

Please sign in to comment.