Skip to content

Commit

Permalink
Fix new Psalm and PHPStan errors (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
lruozzi9 committed Nov 17, 2023
1 parent 5d1746b commit a984b5e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
<projectFiles>
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
<directory name="vendor"/>
<file name="src/DependencyInjection/Configuration.php"/>
</ignoreFiles>
</projectFiles>

Expand Down
2 changes: 1 addition & 1 deletion src/Middleware/ItemImportResultPersisterMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function handle(Envelope $envelope, StackInterface $stack): Envelope
return $result;
}

if (!$envelope->last(ReceivedStamp::class)) {
if (null === $envelope->last(ReceivedStamp::class)) {
return $result;
}

Expand Down
4 changes: 4 additions & 0 deletions src/Product/ProductOptionsResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
use Sylius\Component\Product\Repository\ProductOptionRepositoryInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;

/**
* @psalm-type AkeneoFamilyVariant array{code: string, labels: array<string, ?string>, variant_attribute_sets: list<array{level: int, axes: list<string>, attributes: list<string>}>}
*/
final class ProductOptionsResolver implements ProductOptionsResolverInterface
{
/**
Expand Down Expand Up @@ -55,6 +58,7 @@ public function resolve(array $akeneoProduct): array
$familyVariantCode = $productResponse['family_variant'];

try {
/** @var AkeneoFamilyVariant $familyVariantResponse */
$familyVariantResponse = $this->apiClient->getFamilyVariantApi()->get($familyCode, $familyVariantCode);
} catch (HttpException $e) {
if ($e->getResponse()->getStatusCode() === 404) {
Expand Down

0 comments on commit a984b5e

Please sign in to comment.