minor #41453 [Form] Document null support in NumberToLocalizedStringTransformer (mbabker)

This PR was merged into the 4.4 branch.

Discussion
----------

[Form] Document null support in NumberToLocalizedStringTransformer

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | N/A
| License       | MIT
| Doc PR        | N/A

`Symfony\Component\Form\Extension\Core\DataTransformer\NumberToLocalizedStringTransformer` explicitly checks for and returns nulls but these aren't documented in the class' doc blocks, which causes static analysis tools to report a false positive when checking for these null values elsewhere.  This adds the missing null types to the doc blocks.

Commits
-------

1fda3d0284 Document null support in NumberToLocalizedStringTransformer
This commit is contained in:
Nicolas Grekas 2021-06-03 13:48:34 +02:00
commit f143c8fd1a
2 changed files with 4 additions and 4 deletions

View File

@ -45,7 +45,7 @@ class MoneyToLocalizedStringTransformer extends NumberToLocalizedStringTransform
/**
* Transforms a normalized format into a localized money string.
*
* @param int|float $value Normalized number
* @param int|float|null $value Normalized number
*
* @return string Localized money string
*
@ -69,7 +69,7 @@ class MoneyToLocalizedStringTransformer extends NumberToLocalizedStringTransform
*
* @param string $value Localized money string
*
* @return int|float Normalized number
* @return int|float|null Normalized number
*
* @throws TransformationFailedException if the given value is not a string
* or if the value can not be transformed

View File

@ -98,7 +98,7 @@ class NumberToLocalizedStringTransformer implements DataTransformerInterface
/**
* Transforms a number type into localized number.
*
* @param int|float $value Number value
* @param int|float|null $value Number value
*
* @return string Localized value
*
@ -133,7 +133,7 @@ class NumberToLocalizedStringTransformer implements DataTransformerInterface
*
* @param string $value The localized value
*
* @return int|float The numeric value
* @return int|float|null The numeric value
*
* @throws TransformationFailedException if the given value is not a string
* or if the value can not be transformed