Generator/Plugin.php
function classAnnotation() {
    $annotation_class_path = explode('\\', $this->component_data['plugin_type_data']['plugin_definition_annotation_name']);
    $annotation_class = array_pop($annotation_class_path);

    // Special case: annotation that's just the plugin ID.
    if (!empty($this->component_data['plugin_type_data']['annotation_id_only'])) {
      $annotation = ClassAnnotation::{$annotation_class}($this->component_data['plugin_name']);

      $annotation_lines = $annotation->render();

      return $annotation_lines;
    }

    $annotation_variables = $this->component_data['plugin_type_data']['plugin_properties'];

    $annotation_data = [];
    foreach ($annotation_variables as $annotation_variable => $annotation_variable_info) {
      if ($annotation_variable == 'id') {
        $annotation_data['id'] = $this->component_data['plugin_name'];
        continue;
      }

      // Hacky workaround for https://github.com/drupal-code-builder/drupal-code-builder/issues/97.
      if (isset($annotation_variable_info['type']) && $annotation_variable_info['type'] == '\Drupal\Core\Annotation\Translation') {
        // The annotation property value is translated.
        $annotation_data[$annotation_variable] = ClassAnnotation::Translation("TODO: replace this with a value");
        continue;
      }

      // It's a plain string.
      $annotation_data[$annotation_variable] = "TODO: replace this with a value";
    }

    $annotation = ClassAnnotation::{$annotation_class}($annotation_data);
    $annotation_lines = $annotation->render();

    return $annotation_lines;
  }
function classAnnotation() {
    $annotation_class_path = explode('\\', $this->component_data['plugin_type_data']['plugin_definition_annotation_name']);
    $annotation_class = array_pop($annotation_class_path);

    // Special case: annotation that's just the plugin ID.
    if (!empty($this->component_data['plugin_type_data']['annotation_id_only'])) {
      $annotation = ClassAnnotation::{$annotation_class}($this->component_data['plugin_name']);

      $annotation_lines = $annotation->render();

      return $annotation_lines;
    }

    $annotation_variables = $this->component_data['plugin_type_data']['plugin_properties'];

    $annotation_data = [];
    foreach ($annotation_variables as $annotation_variable => $annotation_variable_info) {
      if ($annotation_variable == 'id') {
        $annotation_data['id'] = $this->component_data['plugin_name'];
        continue;
      }

      // Hacky workaround for https://github.com/drupal-code-builder/drupal-code-builder/issues/97.
      if (isset($annotation_variable_info['type']) && $annotation_variable_info['type'] == '\Drupal\Core\Annotation\Translation') {
        // The annotation property value is translated.
        $annotation_data[$annotation_variable] = ClassAnnotation::Translation("TODO: replace this with a value");
        continue;
      }

      // It's a plain string.
      $annotation_data[$annotation_variable] = "TODO: replace this with a value";
    }

    $annotation = ClassAnnotation::{$annotation_class}($annotation_data);
    $annotation_lines = $annotation->render();

    return $annotation_lines;
  }
function classAnnotation ( ) { $ annotation_class_path = explode ( '\\' , $ this -> component_data [ 'plugin_type_data' ] [ 'plugin_definition_annotation_name' ] ) ; $ annotation_class = array_pop ( $ annotation_class_path ) ; // Special case: annotation that's just the plugin ID. if ( ! empty ( $ this -> component_data [ 'plugin_type_data' ] [ 'annotation_id_only' ] ) ) { $ annotation = ClassAnnotation :: { $ annotation_class } ( $ this -> component_data [ 'plugin_name' ] ) ; $ annotation_lines = $ annotation -> render ( ) ; return $ annotation_lines ; } $ annotation_variables = $ this -> component_data [ 'plugin_type_data' ] [ 'plugin_properties' ] ; $ annotation_data = [ ] ; foreach ( $ annotation_variables as $ annotation_variable => $ annotation_variable_info ) { if ( $ annotation_variable == 'id' ) { $ annotation_data [ 'id' ] = $ this -> component_data [ 'plugin_name' ] ; continue ; } // Hacky workaround for https://github.com/drupal-code-builder/drupal-code-builder/issues/97. if ( isset ( $ annotation_variable_info [ 'type' ] ) && $ annotation_variable_info [ 'type' ] == '\Drupal\Core\Annotation\Translation' ) { // The annotation property value is translated. $ annotation_data [ $ annotation_variable ] = ClassAnnotation :: Translation ( "TODO: replace this with a value" ) ; continue ; } // It's a plain string. $ annotation_data [ $ annotation_variable ] = "TODO: replace this with a value" ; } $ annotation = ClassAnnotation :: { $ annotation_class } ( $ annotation_data ) ; $ annotation_lines = $ annotation -> render ( ) ; return $ annotation_lines ; }
Produces the plugin class annotation lines.

@return
An array of lines suitable for docBlock().
Produces the plugin class annotation lines .