Loading field_inheritance.api.php +4 −4 Original line number Diff line number Diff line Loading @@ -23,16 +23,16 @@ function hook_field_inheritance_inheritance_class_alter(&$class, $field) { * Alter the computed value for an inherited field. * * @param array $value * Array of field item values * Array of field item values. * @param array $context * Array of context information for the field inheritance, with keys: * - source_field * - source_entity * - destination_field * - destination_entity * - method * - method. */ function field_inheritance_field_inheritance_compute_value_alter(&$value, $context) { function field_inheritance_field_inheritance_compute_value_alter(array &$value, array $context) { if ($context['destination_field'] === 'my_field') { $value[0]['value'] = 'foo'; } Loading src/Entity/FieldInheritance.php +8 −8 Original line number Diff line number Diff line Loading @@ -127,7 +127,7 @@ class FieldInheritance extends ConfigEntityBase implements FieldInheritanceInter * {@inheritdoc} */ public function type() { return isset($this->type) ? $this->type : NULL; return $this->type ?? NULL; } /** Loading @@ -142,49 +142,49 @@ class FieldInheritance extends ConfigEntityBase implements FieldInheritanceInter * {@inheritdoc} */ public function sourceEntityType() { return isset($this->sourceEntityType) ? $this->sourceEntityType : NULL; return $this->sourceEntityType ?? NULL; } /** * {@inheritdoc} */ public function destinationEntityType() { return isset($this->destinationEntityType) ? $this->destinationEntityType : NULL; return $this->destinationEntityType ?? NULL; } /** * {@inheritdoc} */ public function sourceEntityBundle() { return isset($this->sourceEntityBundle) ? $this->sourceEntityBundle : NULL; return $this->sourceEntityBundle ?? NULL; } /** * {@inheritdoc} */ public function destinationEntityBundle() { return isset($this->destinationEntityBundle) ? $this->destinationEntityBundle : NULL; return $this->destinationEntityBundle ?? NULL; } /** * {@inheritdoc} */ public function sourceField() { return isset($this->sourceField) ? $this->sourceField : NULL; return $this->sourceField ?? NULL; } /** * {@inheritdoc} */ public function destinationField() { return isset($this->destinationField) ? $this->destinationField : NULL; return $this->destinationField ?? NULL; } /** * {@inheritdoc} */ public function plugin() { return isset($this->plugin) ? $this->plugin : NULL; return $this->plugin ?? NULL; } /** Loading src/Form/FieldInheritanceForm.php +0 −1 Original line number Diff line number Diff line Loading @@ -419,7 +419,6 @@ class FieldInheritanceForm extends EntityForm { ]; } return $form; } Loading Loading
field_inheritance.api.php +4 −4 Original line number Diff line number Diff line Loading @@ -23,16 +23,16 @@ function hook_field_inheritance_inheritance_class_alter(&$class, $field) { * Alter the computed value for an inherited field. * * @param array $value * Array of field item values * Array of field item values. * @param array $context * Array of context information for the field inheritance, with keys: * - source_field * - source_entity * - destination_field * - destination_entity * - method * - method. */ function field_inheritance_field_inheritance_compute_value_alter(&$value, $context) { function field_inheritance_field_inheritance_compute_value_alter(array &$value, array $context) { if ($context['destination_field'] === 'my_field') { $value[0]['value'] = 'foo'; } Loading
src/Entity/FieldInheritance.php +8 −8 Original line number Diff line number Diff line Loading @@ -127,7 +127,7 @@ class FieldInheritance extends ConfigEntityBase implements FieldInheritanceInter * {@inheritdoc} */ public function type() { return isset($this->type) ? $this->type : NULL; return $this->type ?? NULL; } /** Loading @@ -142,49 +142,49 @@ class FieldInheritance extends ConfigEntityBase implements FieldInheritanceInter * {@inheritdoc} */ public function sourceEntityType() { return isset($this->sourceEntityType) ? $this->sourceEntityType : NULL; return $this->sourceEntityType ?? NULL; } /** * {@inheritdoc} */ public function destinationEntityType() { return isset($this->destinationEntityType) ? $this->destinationEntityType : NULL; return $this->destinationEntityType ?? NULL; } /** * {@inheritdoc} */ public function sourceEntityBundle() { return isset($this->sourceEntityBundle) ? $this->sourceEntityBundle : NULL; return $this->sourceEntityBundle ?? NULL; } /** * {@inheritdoc} */ public function destinationEntityBundle() { return isset($this->destinationEntityBundle) ? $this->destinationEntityBundle : NULL; return $this->destinationEntityBundle ?? NULL; } /** * {@inheritdoc} */ public function sourceField() { return isset($this->sourceField) ? $this->sourceField : NULL; return $this->sourceField ?? NULL; } /** * {@inheritdoc} */ public function destinationField() { return isset($this->destinationField) ? $this->destinationField : NULL; return $this->destinationField ?? NULL; } /** * {@inheritdoc} */ public function plugin() { return isset($this->plugin) ? $this->plugin : NULL; return $this->plugin ?? NULL; } /** Loading
src/Form/FieldInheritanceForm.php +0 −1 Original line number Diff line number Diff line Loading @@ -419,7 +419,6 @@ class FieldInheritanceForm extends EntityForm { ]; } return $form; } Loading