Skip to content

Commit 08c85cc

Browse files
committed
[Form] cs fixes in date types
1 parent 0273428 commit 08c85cc

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Extension/Core/Type/DateTimeType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public function buildView(FormView $view, FormInterface $form, array $options)
198198
public function setDefaultOptions(OptionsResolverInterface $resolver)
199199
{
200200
$compound = function (Options $options) {
201-
return $options['widget'] !== 'single_text';
201+
return 'single_text' !== $options['widget'];
202202
};
203203

204204
// Defaults to the value of "widget"

Extension/Core/Type/DateType.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
7878
$pattern
7979
);
8080

81-
// new \intlDateFormatter may return null instead of false in case of failure, see https://bugs.php.net/bug.php?id=66323
81+
// new \IntlDateFormatter may return null instead of false in case of failure, see https://bugs.php.net/bug.php?id=66323
8282
if (!$formatter) {
8383
throw new InvalidOptionsException(intl_get_error_message(), intl_get_error_code());
8484
}
@@ -171,7 +171,7 @@ public function finishView(FormView $view, FormInterface $form, array $options)
171171
public function setDefaultOptions(OptionsResolverInterface $resolver)
172172
{
173173
$compound = function (Options $options) {
174-
return $options['widget'] !== 'single_text';
174+
return 'single_text' !== $options['widget'];
175175
};
176176

177177
$emptyValue = $emptyValueDefault = function (Options $options) {
@@ -196,7 +196,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
196196
};
197197

198198
$format = function (Options $options) {
199-
return $options['widget'] === 'single_text' ? DateType::HTML5_FORMAT : DateType::DEFAULT_FORMAT;
199+
return 'single_text' === $options['widget'] ? DateType::HTML5_FORMAT : DateType::DEFAULT_FORMAT;
200200
};
201201

202202
$resolver->setDefaults(array(

Extension/Core/Type/TimeType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public function buildView(FormView $view, FormInterface $form, array $options)
157157
public function setDefaultOptions(OptionsResolverInterface $resolver)
158158
{
159159
$compound = function (Options $options) {
160-
return $options['widget'] !== 'single_text';
160+
return 'single_text' !== $options['widget'];
161161
};
162162

163163
$emptyValue = $emptyValueDefault = function (Options $options) {

0 commit comments

Comments
 (0)