Skip to content

Commit

Permalink
Fix Psalm error
Browse files Browse the repository at this point in the history
  • Loading branch information
loevgaard committed Jan 2, 2025
1 parent b16ec9b commit b36a05b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Calculator/ProductVariantPricesCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,15 @@ private function getPersistedPrices(ProductVariantInterface $productVariant, arr

private static function getMinimumPrice(ChannelPricingInterface $channelPricing): int
{
$minimumPrice = 0;

if (method_exists($channelPricing, 'getMinimumPrice')) {
return $channelPricing->getMinimumPrice();
$minimumPrice = $channelPricing->getMinimumPrice();

Check failure on line 98 in src/Calculator/ProductVariantPricesCalculator.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (PHP8.1 | Deps: lowest | SF~5.4.0)

MixedAssignment

src/Calculator/ProductVariantPricesCalculator.php:98:13: MixedAssignment: Unable to determine the type that $minimumPrice is being assigned to (see https://psalm.dev/032)

Check failure on line 98 in src/Calculator/ProductVariantPricesCalculator.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (PHP8.2 | Deps: lowest | SF~5.4.0)

MixedAssignment

src/Calculator/ProductVariantPricesCalculator.php:98:13: MixedAssignment: Unable to determine the type that $minimumPrice is being assigned to (see https://psalm.dev/032)
}

return 0;
/** @psalm-suppress RedundantCondition */
Assert::integer($minimumPrice);

return $minimumPrice;
}
}

0 comments on commit b36a05b

Please sign in to comment.