Skip to content
Snippets Groups Projects

Issue #3470405 by TR: [10.3] Convert FieldFormatter plugin from annotation to attributes

1 file
+ 9
0
Compare changes
  • Side-by-side
  • Inline
@@ -2,11 +2,13 @@
namespace Drupal\votingapi_widgets\Plugin\Field\FieldFormatter;
use Drupal\Core\Field\Attribute\FieldFormatter;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\FormatterBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\votingapi\VoteResultFunctionManager;
use Drupal\votingapi_widgets\Plugin\VotingApiWidgetManager;
use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -22,6 +24,13 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
* }
* )
*/
#[FieldFormatter(
id: 'voting_api_formatter',
label: new TranslatableMarkup('Voting API formatter'),
field_types: [
'voting_api_field',
],
)]
class VotingApiFormatter extends FormatterBase implements ContainerFactoryPluginInterface {
/**
Loading