Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f143c8f

Browse filesBrowse files
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 ------- 1fda3d0 Document null support in NumberToLocalizedStringTransformer
2 parents b439213 + 1fda3d0 commit f143c8f
Copy full SHA for f143c8f

File tree

Expand file treeCollapse file tree

2 files changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+4
-4
lines changed

‎src/Symfony/Component/Form/Extension/Core/DataTransformer/MoneyToLocalizedStringTransformer.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/DataTransformer/MoneyToLocalizedStringTransformer.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __construct(?int $scale = 2, ?bool $grouping = true, ?int $round
4545
/**
4646
* Transforms a normalized format into a localized money string.
4747
*
48-
* @param int|float $value Normalized number
48+
* @param int|float|null $value Normalized number
4949
*
5050
* @return string Localized money string
5151
*
@@ -69,7 +69,7 @@ public function transform($value)
6969
*
7070
* @param string $value Localized money string
7171
*
72-
* @return int|float Normalized number
72+
* @return int|float|null Normalized number
7373
*
7474
* @throws TransformationFailedException if the given value is not a string
7575
* or if the value can not be transformed

‎src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function __construct(int $scale = null, ?bool $grouping = false, ?int $ro
9898
/**
9999
* Transforms a number type into localized number.
100100
*
101-
* @param int|float $value Number value
101+
* @param int|float|null $value Number value
102102
*
103103
* @return string Localized value
104104
*
@@ -133,7 +133,7 @@ public function transform($value)
133133
*
134134
* @param string $value The localized value
135135
*
136-
* @return int|float The numeric value
136+
* @return int|float|null The numeric value
137137
*
138138
* @throws TransformationFailedException if the given value is not a string
139139
* or if the value can not be transformed

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.