Skip to content

Commit

Permalink
Fix weak checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek authored Nov 26, 2024
1 parent 98a71d8 commit f60371d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Controller/PackageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function listAction(Request $req,
$filters = array_filter([
'type' => $type,
'vendor' => $vendor,
]);
], fn ($val) => $val !== null);

$response = new JsonResponse(['packages' => $repo->getPackagesWithFields($filters, $fields)]);
$response->setSharedMaxAge(300);
Expand All @@ -122,7 +122,7 @@ public function listAction(Request $req,
return $response;
}

if ($type || $vendor) {
if ($type !== null || $vendor !== null) {
$names = $repo->getPackageNamesByTypeAndVendor($type, $vendor);
} else {
$names = $this->providerManager->getPackageNames();
Expand Down

0 comments on commit f60371d

Please sign in to comment.