diff --git a/src/Plugin/Field/FieldFormatter/ColorFieldFormatterCss.php b/src/Plugin/Field/FieldFormatter/ColorFieldFormatterCss.php index 053191a3baddb9bb1877da4857078f34beadd327..585b192ca3a8660521cd53e93f1eaf1d6b59213c 100644 --- a/src/Plugin/Field/FieldFormatter/ColorFieldFormatterCss.php +++ b/src/Plugin/Field/FieldFormatter/ColorFieldFormatterCss.php @@ -7,6 +7,7 @@ namespace Drupal\color_field\Plugin\Field\FieldFormatter; +use Drupal\color_field\Plugin\Field\FieldType\ColorFieldType; use Drupal\Core\Field\FormatterBase; use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Form\FormStateInterface; @@ -141,7 +142,7 @@ class ColorFieldFormatterCss extends FormatterBase { /** * {@inheritdoc} */ - protected function viewValue(FieldItemInterface $item) { + protected function viewValue(ColorFieldType $item) { $opacity = $this->getFieldSetting('opacity'); $settings = $this->getSettings(); diff --git a/src/Plugin/Field/FieldFormatter/ColorFieldFormatterSwatch.php b/src/Plugin/Field/FieldFormatter/ColorFieldFormatterSwatch.php index c2ea2103e7db9020ccdd66ab77980775561c7e86..7b0b5616f5191cb0ab2786d5d645827757c76846 100644 --- a/src/Plugin/Field/FieldFormatter/ColorFieldFormatterSwatch.php +++ b/src/Plugin/Field/FieldFormatter/ColorFieldFormatterSwatch.php @@ -7,6 +7,7 @@ namespace Drupal\color_field\Plugin\Field\FieldFormatter; +use Drupal\color_field\Plugin\Field\FieldType\ColorFieldType; use Drupal\Core\Field\FormatterBase; use Drupal\Core\Field\FieldItemInterface; use Drupal\Core\Field\FieldItemListInterface; @@ -147,7 +148,7 @@ class ColorFieldFormatterSwatch extends FormatterBase { /** * {@inheritdoc} */ - protected function viewValue(FieldItemInterface $item) { + protected function viewValue(ColorFieldType $item) { $opacity = $this->getFieldSetting('opacity'); $settings = $this->getSettings(); diff --git a/src/Plugin/Field/FieldFormatter/ColorFieldFormatterText.php b/src/Plugin/Field/FieldFormatter/ColorFieldFormatterText.php index eba6199cb5434ed4550881ae55877a858ea813b6..b6ef971cb03191a19571de9985d3575ea79760fa 100644 --- a/src/Plugin/Field/FieldFormatter/ColorFieldFormatterText.php +++ b/src/Plugin/Field/FieldFormatter/ColorFieldFormatterText.php @@ -7,7 +7,7 @@ namespace Drupal\color_field\Plugin\Field\FieldFormatter; -use Drupal\Core\Field\FieldItemInterface; +use Drupal\color_field\Plugin\Field\FieldType\ColorFieldType; use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Field\FormatterBase; use Drupal\Core\Form\FormStateInterface; @@ -114,7 +114,7 @@ class ColorFieldFormatterText extends FormatterBase { /** * {@inheritdoc} */ - protected function viewValue(FieldItemInterface $item) { + protected function viewValue(ColorFieldType $item) { $opacity = $this->getFieldSetting('opacity'); $settings = $this->getSettings();