diff --git a/core/lib/Drupal/Core/Field/WidgetBase.php b/core/lib/Drupal/Core/Field/WidgetBase.php index 4da8a54edf..cfc2478f83 100644 --- a/core/lib/Drupal/Core/Field/WidgetBase.php +++ b/core/lib/Drupal/Core/Field/WidgetBase.php @@ -120,7 +120,7 @@ public function form(FieldItemListInterface $items, array &$form, FormStateInter // Populate the 'array_parents' information in $form_state->get('field') // after the form is built, so that we catch changes in the form structure // performed in alter() hooks. - $elements['#after_build'][] = [get_class($this), 'afterBuild']; + $elements['#after_build'][] = [static::class, 'afterBuild']; $elements['#field_name'] = $field_name; $elements['#field_parents'] = $parents; // Enforce the structure of submitted values. @@ -225,13 +225,13 @@ protected function formMultipleElements(FieldItemListInterface $items, array &$f '#type' => 'submit', '#value' => t('Remove'), '#validate' => [], - '#submit' => [[get_class($this), 'submitRemove']], + '#submit' => [[static::class, 'submitRemove']], '#limit_validation_errors' => [], '#attributes' => [ 'class' => ['remove-field-delta--' . $delta], ], '#ajax' => [ - 'callback' => [get_class($this), 'removeAjaxContentRefresh'], + 'callback' => [static::class, 'removeAjaxContentRefresh'], 'wrapper' => $wrapper_id, 'effect' => 'fade', ], @@ -267,9 +267,9 @@ protected function formMultipleElements(FieldItemListInterface $items, array &$f '#value' => $delta > 0 ? t('Add another item') : t('Add item'), '#attributes' => ['class' => ['field-add-more-submit']], '#limit_validation_errors' => [], - '#submit' => [[get_class($this), 'addMoreSubmit']], + '#submit' => [[static::class, 'addMoreSubmit']], '#ajax' => [ - 'callback' => [get_class($this), 'addMoreAjax'], + 'callback' => [static::class, 'addMoreAjax'], 'wrapper' => $wrapper_id, 'effect' => 'fade', ],