Skip to content

Fix psalm errors

Fix psalm errors #64

Triggered via pull request February 25, 2024 14:26
Status Failure
Total duration 59s
Artifacts

code_checks.yaml

on: pull_request
Matrix: tests
Fit to window
Zoom out
Zoom in

Annotations

10 errors
MissingTemplateParam: src/Form/DataTransformer/CurrencyToArrayTransformer.php#L17
src/Form/DataTransformer/CurrencyToArrayTransformer.php:17:45: MissingTemplateParam: Tbbc\MoneyBundle\Form\DataTransformer\CurrencyToArrayTransformer has missing template params when extending Symfony\Component\Form\DataTransformerInterface, expecting 2 (see https://psalm.dev/182)
MissingTemplateParam: src/Form/DataTransformer/MoneyToArrayTransformer.php#L16
src/Form/DataTransformer/MoneyToArrayTransformer.php:16:42: MissingTemplateParam: Tbbc\MoneyBundle\Form\DataTransformer\MoneyToArrayTransformer has missing template params when extending Symfony\Component\Form\DataTransformerInterface, expecting 2 (see https://psalm.dev/182)
MissingParamType: src/Form/DataTransformer/MoneyToArrayTransformer.php#L30
src/Form/DataTransformer/MoneyToArrayTransformer.php:30:31: MissingParamType: Parameter $value has no provided type (see https://psalm.dev/154)
ArgumentTypeCoercion: src/Form/DataTransformer/MoneyToArrayTransformer.php#L73
src/Form/DataTransformer/MoneyToArrayTransformer.php:73:38: ArgumentTypeCoercion: Argument 1 of Money\Currency::__construct expects non-empty-string, but parent type string provided (see https://psalm.dev/193)
MissingParamType: src/Form/DataTransformer/SimpleMoneyToArrayTransformer.php#L24
src/Form/DataTransformer/SimpleMoneyToArrayTransformer.php:24:31: MissingParamType: Parameter $value has no provided type (see https://psalm.dev/154)
InvalidReturnStatement: src/Form/DataTransformer/SimpleMoneyToArrayTransformer.php#L32
src/Form/DataTransformer/SimpleMoneyToArrayTransformer.php:32:16: InvalidReturnStatement: The inferred type 'array{tbbc_amount: string}' does not match the declared return type 'array{tbbc_amount: string, tbbc_currency: Money\Currency}|null' for Tbbc\MoneyBundle\Form\DataTransformer\SimpleMoneyToArrayTransformer::transform (see https://psalm.dev/128)
ArgumentTypeCoercion: src/Money/MoneyManager.php#L27
src/Money/MoneyManager.php:27:34: ArgumentTypeCoercion: Argument 1 of Money\Currency::__construct expects non-empty-string, but parent type string provided (see https://psalm.dev/193)
MixedReturnTypeCoercion: src/Pair/PairManager.php#L130
src/Pair/PairManager.php:130:44: MixedReturnTypeCoercion: The declared return type 'array<array-key, string>' for Tbbc\MoneyBundle\Pair\PairManager::getCurrencyCodeList is more specific than the inferred return type 'array<array-key, mixed>' (see https://psalm.dev/197)
MixedReturnTypeCoercion: src/Pair/PairManager.php#L132
src/Pair/PairManager.php:132:16: MixedReturnTypeCoercion: The type 'array<array-key, mixed>' is more general than the declared return type 'array<array-key, string>' for Tbbc\MoneyBundle\Pair\PairManager::getCurrencyCodeList (see https://psalm.dev/197)
InvalidReturnType: src/Pair/PairManager.php#L146
src/Pair/PairManager.php:146:37: InvalidReturnType: The declared return type 'array<string, float>' for Tbbc\MoneyBundle\Pair\PairManager::getRatioList is incorrect, got 'array<string, float|null>' (see https://psalm.dev/011)