diff --git a/core/modules/field/field.api.php b/core/modules/field/field.api.php index e8098ad..92e9eb6 100644 --- a/core/modules/field/field.api.php +++ b/core/modules/field/field.api.php @@ -411,12 +411,12 @@ function hook_field_info_max_weight($entity_type, $bundle, $context, $context_mo * To forbid the update from occurring, throw a * Drupal\field\FieldConfigUpdateForbiddenException. * - * @param $field + * @param \Drupal\field\FieldConfigInterface $field * The field as it will be post-update. - * @param $prior_field + * @param \Drupal\field\FieldConfigInterface $prior_field * The field as it is pre-update. */ -function hook_field_config_update_forbid($field, $prior_field) { +function hook_field_config_update_forbid(\Drupal\field\FieldConfigInterface $field, \Drupal\field\FieldConfigInterface $prior_field) { // A 'list' field stores integer keys mapped to display values. If // the new field will have fewer values, and any data exists for the // abandoned keys, the field will have no way to display them. So, diff --git a/core/modules/field/tests/modules/field_test/field_test.field.inc b/core/modules/field/tests/modules/field_test/field_test.field.inc index 321fac8..79b57a3 100644 --- a/core/modules/field/tests/modules/field_test/field_test.field.inc +++ b/core/modules/field/tests/modules/field_test/field_test.field.inc @@ -9,6 +9,7 @@ use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Session\AccountInterface; +use Drupal\field\FieldConfigInterface; use Drupal\field\FieldConfigUpdateForbiddenException; /** @@ -21,7 +22,7 @@ function field_test_field_widget_info_alter(&$info) { /** * Implements hook_field_config_update_forbid(). */ -function field_test_field_config_update_forbid($field, $prior_field) { +function field_test_field_config_update_forbid(FieldConfigInterface $field, FieldConfigInterface $prior_field) { if ($field->getType() == 'test_field' && $field->getSetting('unchangeable') != $prior_field->getSetting('unchangeable')) { throw new FieldConfigUpdateForbiddenException("field_test 'unchangeable' setting cannot be changed'"); } diff --git a/core/modules/options/options.module b/core/modules/options/options.module index 0421b84..1d328f6 100644 --- a/core/modules/options/options.module +++ b/core/modules/options/options.module @@ -102,7 +102,7 @@ function options_allowed_values(FieldDefinitionInterface $field_definition, Enti /** * Implements hook_field_config_update_forbid(). */ -function options_field_config_update_forbid($field, $prior_field) { +function options_field_config_update_forbid(FieldConfigInterface $field, FieldConfigInterface $prior_field) { if ($field->module == 'options' && $field->hasData()) { // Forbid any update that removes allowed values with actual data. $allowed_values = $field->getSetting('allowed_values');