Skip to content

Commit

Permalink
Fix PHPStan errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pierredup committed Nov 22, 2023
1 parent b70da11 commit d9f3666
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/MoneyBundle/Form/DataTransformer/ViewTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(Currency $currency)
$this->currency = $currency;
}

public function transform($value)
public function transform($value): float
{
if ($value instanceof Money) {
return (float) ($value->getAmount() / 100);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public function testTransformsMoneyObjectToFloat($money, $expected): void
self::assertSame($expected, $value);
}

/**
* @return iterable<array<float|int|null>>
*/
public function reverseTransformDataProvider(): iterable
{
yield [null, 0];
Expand All @@ -72,6 +75,9 @@ public function reverseTransformDataProvider(): iterable
yield [0.99, 99];
}

/**
* @return iterable<array<Money|string|float|null>>
*/
public function transformDataProvider(): iterable
{
yield [null, 0.0];
Expand Down

0 comments on commit d9f3666

Please sign in to comment.