Skip to content

Commit

Permalink
Fix psalm
Browse files Browse the repository at this point in the history
  • Loading branch information
mustanggb authored Feb 25, 2024
1 parent 01c4f77 commit f7cb40a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/Form/DataTransformer/CurrencyToArrayTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class CurrencyToArrayTransformer implements DataTransformerInterface
{
/**
* {@inheritdoc}
*
* @psalm-param Currency|null $value

Check failure on line 24 in src/Form/DataTransformer/CurrencyToArrayTransformer.php

View workflow job for this annotation

GitHub Actions / psalm

MismatchingDocblockParamType

src/Form/DataTransformer/CurrencyToArrayTransformer.php:24:21: MismatchingDocblockParamType: Parameter $value has wrong type 'Money\Currency|null', should be 'Money\Currency' (see https://psalm.dev/141)
*/
public function transform(Currency $value): ?array

Check failure on line 26 in src/Form/DataTransformer/CurrencyToArrayTransformer.php

View workflow job for this annotation

GitHub Actions / psalm

MethodSignatureMismatch

src/Form/DataTransformer/CurrencyToArrayTransformer.php:26:40: MethodSignatureMismatch: Argument 1 of Tbbc\MoneyBundle\Form\DataTransformer\CurrencyToArrayTransformer::transform has wrong type 'Money\Currency', expecting 'mixed' as defined by Symfony\Component\Form\DataTransformerInterface::transform (see https://psalm.dev/042)
{
Expand All @@ -35,6 +37,8 @@ public function transform(Currency $value): ?array

/**
* {@inheritdoc}
*
* @psalm-param array|null $value

Check failure on line 41 in src/Form/DataTransformer/CurrencyToArrayTransformer.php

View workflow job for this annotation

GitHub Actions / psalm

MismatchingDocblockParamType

src/Form/DataTransformer/CurrencyToArrayTransformer.php:41:21: MismatchingDocblockParamType: Parameter $value has wrong type 'array<array-key, mixed>|null', should be 'array<array-key, mixed>' (see https://psalm.dev/141)
*/
public function reverseTransform(array $value): ?Currency

Check failure on line 43 in src/Form/DataTransformer/CurrencyToArrayTransformer.php

View workflow job for this annotation

GitHub Actions / psalm

MethodSignatureMismatch

src/Form/DataTransformer/CurrencyToArrayTransformer.php:43:44: MethodSignatureMismatch: Argument 1 of Tbbc\MoneyBundle\Form\DataTransformer\CurrencyToArrayTransformer::reverseTransform has wrong type 'array<array-key, mixed>', expecting 'mixed' as defined by Symfony\Component\Form\DataTransformerInterface::reverseTransform (see https://psalm.dev/042)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Form/DataTransformer/MoneyToArrayTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Symfony\Component\Form\Extension\Core\DataTransformer\MoneyToLocalizedStringTransformer;

/**
* Transforms between a Money instance and an array.
* Transforms between a Money and an array.
*/
class MoneyToArrayTransformer implements DataTransformerInterface

Check failure on line 17 in src/Form/DataTransformer/MoneyToArrayTransformer.php

View workflow job for this annotation

GitHub Actions / psalm

MissingTemplateParam

src/Form/DataTransformer/MoneyToArrayTransformer.php:17:42: MissingTemplateParam: Tbbc\MoneyBundle\Form\DataTransformer\MoneyToArrayTransformer has missing template params when extending Symfony\Component\Form\DataTransformerInterface, expecting 2 (see https://psalm.dev/182)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Form/DataTransformer/SimpleMoneyToArrayTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Money\Money;

/**
* Transforms between a Money instance and an array.
* Transforms between a Money and an array.
*/
class SimpleMoneyToArrayTransformer extends MoneyToArrayTransformer
{
Expand Down

0 comments on commit f7cb40a

Please sign in to comment.