Skip to content

Commit ed46a30

Browse files
committed
Fix psalm errors
1 parent 790e704 commit ed46a30

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Feed/BrndFeedType.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function getData(Feed $feed): array
7070
$baseUri = $secrets->apiBaseUri;
7171
$sportCenterId = $configuration['sport_center_id'] ?? null;
7272

73-
if (empty($baseUri) || empty($sportCenterId)) {
73+
if ($baseUri === null || $baseUri === '' || $sportCenterId === null || $sportCenterId === '') {
7474
return $result;
7575
}
7676

@@ -91,7 +91,7 @@ private function parseBrndBooking(array $booking): array
9191
{
9292
// Parse start time
9393
$startDateTime = null;
94-
if (!empty($booking['dato']) && !empty($booking['starttid'])) {
94+
if (!empty($booking['dato']) && isset($booking['starttid']) && is_string($booking['starttid'])) {
9595
// Trim starttid to 6 digits after dot for microseconds
9696
$starttid = preg_replace('/\.(\d{6})\d+$/', '.$1', $booking['starttid']);
9797
$dateOnly = substr($booking['dato'], 0, 10);
@@ -101,7 +101,7 @@ private function parseBrndBooking(array $booking): array
101101

102102
// Parse end time
103103
$endDateTime = null;
104-
if (!empty($booking['dato']) && !empty($booking['sluttid'])) {
104+
if (!empty($booking['dato']) && isset($booking['sluttid']) && is_string($booking['sluttid'])) {
105105
$sluttid = preg_replace('/\.(\d{6})\d+$/', '.$1', $booking['sluttid']);
106106
$dateOnly = substr($booking['dato'], 0, 10);
107107
$dateTimeString = $dateOnly . ' ' . $sluttid;

0 commit comments

Comments
 (0)