Skip to content

Commit

Permalink
Resolve phpstan issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Wojdylak committed Nov 30, 2023
1 parent 6d33557 commit 440a75a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 22 deletions.
20 changes: 0 additions & 20 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -805,26 +805,6 @@ parameters:
count: 1
path: src/Sylius/Bundle/ApiBundle/DataPersister/ProductTaxonDataPersister.php

-
message: "#^Method Sylius\\\\Bundle\\\\ApiBundle\\\\DataPersister\\\\PromotionCouponDataPersister\\:\\:persist\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#"
count: 1
path: src/Sylius/Bundle/ApiBundle/DataPersister/PromotionCouponDataPersister.php

-
message: "#^Method Sylius\\\\Bundle\\\\ApiBundle\\\\DataPersister\\\\PromotionCouponDataPersister\\:\\:remove\\(\\) has no return type specified\\.$#"
count: 1
path: src/Sylius/Bundle/ApiBundle/DataPersister/PromotionCouponDataPersister.php

-
message: "#^Method Sylius\\\\Bundle\\\\ApiBundle\\\\DataPersister\\\\PromotionCouponDataPersister\\:\\:remove\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#"
count: 1
path: src/Sylius/Bundle/ApiBundle/DataPersister/PromotionCouponDataPersister.php

-
message: "#^Method Sylius\\\\Bundle\\\\ApiBundle\\\\DataPersister\\\\PromotionCouponDataPersister\\:\\:supports\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#"
count: 1
path: src/Sylius/Bundle/ApiBundle/DataPersister/PromotionCouponDataPersister.php

-
message: "#^Method Sylius\\\\Bundle\\\\ApiBundle\\\\DataPersister\\\\ProductTaxonDataPersister\\:\\:remove\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#"
count: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,23 @@ public function __construct(
) {
}

/** @param array<array-key, mixed> $context */
public function supports($data, array $context = []): bool
{
return $data instanceof PromotionCouponInterface;
}

/** @param array<array-key, mixed> $context */
public function persist($data, array $context = [])
{
return $this->decoratedDataPersister->persist($data, $context);
}

public function remove($data, array $context = [])
/** @param array<array-key, mixed> $context */
public function remove($data, array $context = []): void
{
try {
return $this->decoratedDataPersister->remove($data, $context);
$this->decoratedDataPersister->remove($data, $context);
} catch (ForeignKeyConstraintViolationException) {
throw new PromotionCouponCannotBeRemoved();
}
Expand Down

0 comments on commit 440a75a

Please sign in to comment.