You are here

protected static function ListStringItem::castAllowedValue in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/options/src/Plugin/Field/FieldType/ListStringItem.php \Drupal\options\Plugin\Field\FieldType\ListStringItem::castAllowedValue()
  2. 10 core/modules/options/src/Plugin/Field/FieldType/ListStringItem.php \Drupal\options\Plugin\Field\FieldType\ListStringItem::castAllowedValue()

Converts a value to the correct type.

Parameters

mixed $value: The value to cast.

Return value

mixed The casted value.

Overrides ListItemBase::castAllowedValue

File

core/modules/options/src/Plugin/Field/FieldType/ListStringItem.php, line 76

Class

ListStringItem
Plugin implementation of the 'list_string' field type.

Namespace

Drupal\options\Plugin\Field\FieldType

Code

protected static function castAllowedValue($value) {
  return (string) $value;
}