Skip to content

Commit

Permalink
Only add schema var if there is content
Browse files Browse the repository at this point in the history
  • Loading branch information
jaudriga committed Apr 22, 2024
1 parent ec0c51c commit 9c2d746
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/Controller/MessagesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,7 @@ public function getBody(int $id): JSONResponse {

if ($extractionLibrary === 'kitinerary') {
$itineraries = $this->itineraryService->extract($account, $mailbox, $message->getUid());
// After setting the above method to extract, $itineraries is always true, so the check
// below will cause psalm composer run psalm to complain in the GitHub CI jobs.
if ($itineraries) {
if ($itineraries && !empty($itineraries)) {

Check failure on line 253 in lib/Controller/MessagesController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-master

RedundantCondition

lib/Controller/MessagesController.php:253:8: RedundantCondition: Operand of type Nextcloud\KItinerary\Itinerary is always truthy (see https://psalm.dev/122)

Check failure on line 253 in lib/Controller/MessagesController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-master

RedundantCondition

lib/Controller/MessagesController.php:253:8: RedundantCondition: $itineraries has already been asserted (see https://psalm.dev/122)

Check failure on line 253 in lib/Controller/MessagesController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-master

RedundantCondition

lib/Controller/MessagesController.php:253:24: RedundantCondition: Operand of type true is always truthy (see https://psalm.dev/122)

Check failure on line 253 in lib/Controller/MessagesController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable28

RedundantCondition

lib/Controller/MessagesController.php:253:8: RedundantCondition: Operand of type Nextcloud\KItinerary\Itinerary is always truthy (see https://psalm.dev/122)

Check failure on line 253 in lib/Controller/MessagesController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable28

RedundantCondition

lib/Controller/MessagesController.php:253:8: RedundantCondition: $itineraries has already been asserted (see https://psalm.dev/122)

Check failure on line 253 in lib/Controller/MessagesController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable28

RedundantCondition

lib/Controller/MessagesController.php:253:24: RedundantCondition: Operand of type true is always truthy (see https://psalm.dev/122)

Check failure on line 253 in lib/Controller/MessagesController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable27

RedundantCondition

lib/Controller/MessagesController.php:253:8: RedundantCondition: Operand of type Nextcloud\KItinerary\Itinerary is always truthy (see https://psalm.dev/122)

Check failure on line 253 in lib/Controller/MessagesController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable27

RedundantCondition

lib/Controller/MessagesController.php:253:8: RedundantCondition: $itineraries has already been asserted (see https://psalm.dev/122)

Check failure on line 253 in lib/Controller/MessagesController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable27

RedundantCondition

lib/Controller/MessagesController.php:253:24: RedundantCondition: Operand of type true is always truthy (see https://psalm.dev/122)

Check failure on line 253 in lib/Controller/MessagesController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable26

RedundantCondition

lib/Controller/MessagesController.php:253:8: RedundantCondition: Operand of type Nextcloud\KItinerary\Itinerary is always truthy (see https://psalm.dev/122)

Check failure on line 253 in lib/Controller/MessagesController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable26

RedundantCondition

lib/Controller/MessagesController.php:253:8: RedundantCondition: $itineraries has already been asserted (see https://psalm.dev/122)

Check failure on line 253 in lib/Controller/MessagesController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable26

RedundantCondition

lib/Controller/MessagesController.php:253:24: RedundantCondition: Operand of type true is always truthy (see https://psalm.dev/122)
$json['schema'] = $itineraries;
}
} else {
Expand Down

0 comments on commit 9c2d746

Please sign in to comment.