Skip to content

Commit

Permalink
Merge pull request #34 from TheDMSGroup/bug/precision-warning
Browse files Browse the repository at this point in the history
Prevent warnings regarding 'precision'
  • Loading branch information
heathdutton committed May 11, 2018
2 parents e8d716f + ac5267d commit 9469567
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
8 changes: 1 addition & 7 deletions Entity/EntityExtendedFieldsBuildFormTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ private function getFormExtendedFields(FormBuilderInterface $builder, array $opt

switch ($type) {
case 'number':
if (empty($properties['precision'])) {
$properties['precision'] = null;
} //ensure default locale is used
else {
$properties['precision'] = (int) $properties['precision'];
}

if ('' === $value) {
// Prevent transform errors
Expand All @@ -76,7 +70,7 @@ private function getFormExtendedFields(FormBuilderInterface $builder, array $opt
'data' => (null !== $value) ? (float) $value : $value,
'mapped' => $mapped,
'constraints' => $constraints,
'precision' => $properties['precision'],
'precision' => isset($properties['precision']) ? (int) $properties['precision'] : 0,
'rounding_mode' => isset($properties['roundmode']) ? (int) $properties['roundmode'] : 0,
]
);
Expand Down
8 changes: 1 addition & 7 deletions Form/UpdateLeadActionExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,6 @@ private function getExtendedFormFields(FormBuilderInterface $builder, array $opt

switch ($type) {
case 'number':
if (empty($properties['precision'])) {
$properties['precision'] = null;
} //ensure default locale is used
else {
$properties['precision'] = (int) $properties['precision'];
}

if ('' === $value) {
// Prevent transform errors
Expand All @@ -142,7 +136,7 @@ private function getExtendedFormFields(FormBuilderInterface $builder, array $opt
'data' => (null !== $value) ? (float) $value : $value,
'mapped' => $mapped,
'constraints' => $constraints,
'precision' => $properties['precision'],
'precision' => isset($properties['precision']) ? (int) $properties['precision'] : 0,
'rounding_mode' => isset($properties['roundmode']) ? (int) $properties['roundmode'] : 0,
]
);
Expand Down

0 comments on commit 9469567

Please sign in to comment.