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:
commit
f143c8fd1a
@ -45,7 +45,7 @@ class MoneyToLocalizedStringTransformer extends NumberToLocalizedStringTransform
|
|||||||
/**
|
/**
|
||||||
* Transforms a normalized format into a localized money string.
|
* 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
|
* @return string Localized money string
|
||||||
*
|
*
|
||||||
@ -69,7 +69,7 @@ class MoneyToLocalizedStringTransformer extends NumberToLocalizedStringTransform
|
|||||||
*
|
*
|
||||||
* @param string $value Localized money string
|
* @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
|
* @throws TransformationFailedException if the given value is not a string
|
||||||
* or if the value can not be transformed
|
* or if the value can not be transformed
|
||||||
|
@ -98,7 +98,7 @@ class NumberToLocalizedStringTransformer implements DataTransformerInterface
|
|||||||
/**
|
/**
|
||||||
* Transforms a number type into localized number.
|
* Transforms a number type into localized number.
|
||||||
*
|
*
|
||||||
* @param int|float $value Number value
|
* @param int|float|null $value Number value
|
||||||
*
|
*
|
||||||
* @return string Localized value
|
* @return string Localized value
|
||||||
*
|
*
|
||||||
@ -133,7 +133,7 @@ class NumberToLocalizedStringTransformer implements DataTransformerInterface
|
|||||||
*
|
*
|
||||||
* @param string $value The localized value
|
* @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
|
* @throws TransformationFailedException if the given value is not a string
|
||||||
* or if the value can not be transformed
|
* or if the value can not be transformed
|
||||||
|
Reference in New Issue
Block a user