Skip to content
Snippets Groups Projects

Issue #3373225: Fix the issues reported by phpcs

3 files
+ 13
7
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -64,7 +64,7 @@ class TimePickerWidget extends WidgetBase {
* {@inheritdoc}
*/
public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
$value = isset($items[$delta]->time) ? $items[$delta]->time : '';
$value = $items[$delta]->time ?? '';
if ($this->fieldDefinition->getFieldStorageDefinition()->getCardinality() == 1) {
$element += [
'#type' => 'fieldset',
@@ -83,7 +83,10 @@ class TimePickerWidget extends WidgetBase {
],
];
$element['#attached']['library'][] = 'time_picker/time_picker';
$element['#attached']['drupalSettings']['time_picker'] = ['hour_format' => $this->getFieldSetting('hour_format'), 'theme_color' => $this->getFieldSetting('time_picker_theme')];
$element['#attached']['drupalSettings']['time_picker'] = [
'hour_format' => $this->getFieldSetting('hour_format'),
'theme_color' => $this->getFieldSetting('time_picker_theme'),
];
return $element;
}
Loading