diff --git a/core/modules/field/lib/Drupal/field/FieldInfo.php b/core/modules/field/lib/Drupal/field/FieldInfo.php index e6411c3..8603d9f 100644 --- a/core/modules/field/lib/Drupal/field/FieldInfo.php +++ b/core/modules/field/lib/Drupal/field/FieldInfo.php @@ -164,7 +164,7 @@ public function flush() { /** * Collects a lightweight map of fields across bundles. * - * @return + * @return array * An array keyed by entity type. Each value is an array which keys are * field names and value is an array with two entries: * - type: The field type. @@ -218,7 +218,7 @@ public function getFieldMap() { /** * Returns all active fields, including deleted ones. * - * @return + * @return \Drupal\field\FieldInterface[] * An array of field definitions, keyed by field ID. */ public function getFields() { @@ -256,10 +256,10 @@ public function getFields() { /** * Retrieves all active, non-deleted instances definitions. * - * @param $entity_type + * @param string $entity_type * (optional) The entity type. * - * @return + * @return array * If $entity_type is not set, all instances keyed by entity type and bundle * name. If $entity_type is set, all instances for that entity type, keyed * by bundle name. @@ -310,7 +310,7 @@ public function getInstances($entity_type = NULL) { * @param string $field_name * The field name. * - * @return + * @return \Drupal\field\FieldInterface|NULL * The field definition, or NULL if no field was found. */ public function getField($entity_type, $field_name) { @@ -345,10 +345,10 @@ public function getField($entity_type, $field_name) { * * This method only retrieves active fields, deleted or not. * - * @param $field_id + * @param string $field_id * The field ID. * - * @return + * @return \Drupal\field\FieldInterface|NULL * The field definition, or NULL if no field was found. */ public function getFieldById($field_id) { @@ -387,12 +387,12 @@ public function getFieldById($field_id) { * The function also populates the corresponding field definitions in the * "static" cache. * - * @param $entity_type + * @param string $entity_type * The entity type. - * @param $bundle + * @param string $bundle * The bundle name. * - * @return + * @return \Drupal\field\FieldInstanceInterface[] * The array of instance definitions, keyed by field name. */ public function getBundleInstances($entity_type, $bundle) { @@ -508,8 +508,8 @@ public function getBundleInstances($entity_type, $bundle) { * @param string $field_name * The field name for the instance. * - * @return array - * An associative array of instance data for the specific field and bundle; + * @return \Drupal\field\FieldInstanceInterface|NULL + * The instance definition for the specific field of the entity bundle; * NULL if the instance does not exist. */ function getInstance($entity_type, $bundle, $field_name) { @@ -522,12 +522,12 @@ function getInstance($entity_type, $bundle, $field_name) { /** * Retrieves the "extra fields" for a bundle. * - * @param $entity_type + * @param string $entity_type * The entity type. - * @param $bundle + * @param string $bundle * The bundle name. * - * @return + * @return array * The array of extra fields. */ public function getBundleExtraFields($entity_type, $bundle) { @@ -560,13 +560,13 @@ public function getBundleExtraFields($entity_type, $bundle) { /** * Prepares a field definition for the current run-time context. * - * @param $field + * @param \Drupal\field\FieldInterface $field * The raw field structure as read from the database. * - * @return + * @return \Drupal\field\FieldInterface * The field definition completed for the current runtime context. */ - public function prepareField($field) { + public function prepareField(FieldInterface $field) { // Make sure all expected field settings are present. $field['settings'] += $this->fieldTypeManager->getDefaultSettings($field['type']); @@ -576,15 +576,15 @@ public function prepareField($field) { /** * Prepares an instance definition for the current run-time context. * - * @param $instance + * @param \Drupal\field\FieldInstanceInterface $instance * The raw instance structure as read from the database. - * @param $field_type + * @param string $field_type * The field type. * - * @return + * @return \Drupal\field\FieldInstanceInterface * The field instance array completed for the current runtime context. */ - public function prepareInstance($instance, $field_type) { + public function prepareInstance(FieldInstanceInterface $instance, $field_type) { // Make sure all expected instance settings are present. $instance['settings'] += $this->fieldTypeManager->getDefaultInstanceSettings($field_type);