Doctrine annotations for custom field formatters in Drupal 8 I am trying to port my Drupal 7 module, Views Hybrid, to Drupal 8. It provides a custom field formatter. In order to provide the field formatter, I am using the Doctrine annotation roughly following this tutorial provided by realize.be. However, I am getting PHP exceptions:

Uncaught PHP Exception Doctrine\Common\Annotations\AnnotationException: 
"[Syntax Error] Expected PlainValue, got '&gt;' 
at position 168 in class 
Drupal\views_hybrid\Plugin\Field\FieldFormatter\HybridFormatter." 
at ~/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php line 41


If I remove the double quotes from the keys inside the settings array then I get a different error:

Uncaught PHP Exception Doctrine\Common\Annotations\AnnotationException: 
"[Semantical Error] Couldn't find constant items_count, class Drupal\views_hybrid\Plugin\Field\FieldFormatter\HybridFormatter." 
at ~/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php line 52


/**
 * Plugin implementation of the 'views_hybrid' formatter.
 *
 * @FieldFormatter(
 *   id = "views_hybrid",
 *   label = @Translation("Views hybrid"),
 *   field_types = {"entity_reference"},
 *   settings = {
 *      "items_count" =&gt; "5",
 *      "view" =&gt; "frontpage",
 *      "display" =&gt; "linked_title_only",
 *      "classes" =&gt; {},
 *      "view_mode" =&gt; "teaser",
 *      "arguments" =&gt; "",
 *   },
 * )
 */


I am not clear about the syntax that Doctrine expects for these nested arrays, or even on whether Drupal 8 expects the settings array to be included in the Doctrine annotations block when declaring a new field formatter, and my usually debugging techniques aren't very useful for debugging annotations since they're not exactly code. What is the expected syntax and content of a Doctrine annotation for defining a field formatter in Drupal 8?
I confused PHP array syntax for annotation syntax. Those =&gt; should be = and the trailing commas need to be removed from lines that are the last in their set. So it should be:

    /**
     * Plugin implementation of the 'views_hybrid' formatter.
     *
     * @FieldFormatter(
     *   id = "views_hybrid",
     *   label = @Translation("Views hybrid"),
     *   field_types = {"entity_reference"},
     *   settings = {
     *      "items_count" = "5",
     *      "view" = "frontpage",
     *      "display" = "linked_title_only",
     *      "classes" = {},
     *      "view_mode" = "teaser",
     *      "arguments" = ""
     *   }
     * )
     */