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 08c85cc

Browse filesBrowse files
committed
[Form] cs fixes in date types
1 parent 0273428 commit 08c85cc
Copy full SHA for 08c85cc

File tree

Expand file treeCollapse file tree

3 files changed

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

3 files changed

+5
-5
lines changed

‎Extension/Core/Type/DateTimeType.php

Copy file name to clipboardExpand all lines: Extension/Core/Type/DateTimeType.php
+1-1Lines 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

Copy file name to clipboardExpand all lines: Extension/Core/Type/DateType.php
+3-3Lines 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

Copy file name to clipboardExpand all lines: Extension/Core/Type/TimeType.php
+1-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.