Task/Collect/PluginTypesCollector.php
protected function gatherPluginTypeInfo($job_list) {
    // Assemble a basic array of plugin type data, that we will successively add
    // data to.
    $plugin_type_data = array();
    foreach ($job_list as $job) {
      $plugin_manager_service_id = $job['service_id'];
      $plugin_type_id = $job['type_id'];

      // Get the class name for the service.
      // Babysit modules that don't define services properly!
      // (I'm looking at Physical.)
      try {
        $service = \Drupal::service($plugin_manager_service_id);
      }
      catch (\Throwable $ex) {
        continue;
      }

      $service = \Drupal::service($plugin_manager_service_id);
      $service_class_name = get_class($service);
      $service_component_namespace = $this->getClassComponentNamespace($service_class_name);

      $plugin_type_data[$plugin_type_id] = [
        'type_id' => $plugin_type_id,
        'service_id' => $plugin_manager_service_id,
        'service_class_name' => $service_class_name,
        'service_component_namespace' => $service_component_namespace,
        // Plugin module may replace this if present.
        'type_label' => $plugin_type_id,
      ];

      // Add data from the plugin type manager service.
      // This gets us the subdirectory, interface, and annotation name.
      $this->addPluginTypeServiceData($plugin_type_data[$plugin_type_id]);

      // Try to detect a base class for plugins
      $this->addPluginBaseClass($plugin_type_data[$plugin_type_id]);

      // Try to detect a config schema prefix.
      $this->addConfigSchemaPrefix($plugin_type_data[$plugin_type_id]);

      // Add data about the factory method of the base class, if any.
      $this->addConstructionData($plugin_type_data[$plugin_type_id]);

      // Do the large arrays last, so they are last in the stored data so it's
      // easier to read.
      // Add data from the plugin annotation class.
      $this->addPluginAnnotationData($plugin_type_data[$plugin_type_id]);

      // Add data from the plugin interface (which the manager service gave us).
      $this->addPluginMethods($plugin_type_data[$plugin_type_id]);
    }

    // Get plugin type information if Plugin module is present.
    // We get data on all plugin types in one go, so this handles the whole
    // data.
    $this->addPluginModuleData($plugin_type_data);

    //drush_print_r($plugin_type_data);

    return $plugin_type_data;
  }
protected function gatherPluginTypeInfo($job_list) {
    // Assemble a basic array of plugin type data, that we will successively add
    // data to.
    $plugin_type_data = array();
    foreach ($job_list as $job) {
      $plugin_manager_service_id = $job['service_id'];
      $plugin_type_id = $job['type_id'];

      // Get the class name for the service.
      // Babysit modules that don't define services properly!
      // (I'm looking at Physical.)
      try {
        $service = \Drupal::service($plugin_manager_service_id);
      }
      catch (\Throwable $ex) {
        continue;
      }

      $service = \Drupal::service($plugin_manager_service_id);
      $service_class_name = get_class($service);
      $service_component_namespace = $this->getClassComponentNamespace($service_class_name);

      $plugin_type_data[$plugin_type_id] = [
        'type_id' => $plugin_type_id,
        'service_id' => $plugin_manager_service_id,
        'service_class_name' => $service_class_name,
        'service_component_namespace' => $service_component_namespace,
        // Plugin module may replace this if present.
        'type_label' => $plugin_type_id,
      ];

      // Add data from the plugin type manager service.
      // This gets us the subdirectory, interface, and annotation name.
      $this->addPluginTypeServiceData($plugin_type_data[$plugin_type_id]);

      // Try to detect a base class for plugins
      $this->addPluginBaseClass($plugin_type_data[$plugin_type_id]);

      // Try to detect a config schema prefix.
      $this->addConfigSchemaPrefix($plugin_type_data[$plugin_type_id]);

      // Add data about the factory method of the base class, if any.
      $this->addConstructionData($plugin_type_data[$plugin_type_id]);

      // Do the large arrays last, so they are last in the stored data so it's
      // easier to read.
      // Add data from the plugin annotation class.
      $this->addPluginAnnotationData($plugin_type_data[$plugin_type_id]);

      // Add data from the plugin interface (which the manager service gave us).
      $this->addPluginMethods($plugin_type_data[$plugin_type_id]);
    }

    // Get plugin type information if Plugin module is present.
    // We get data on all plugin types in one go, so this handles the whole
    // data.
    $this->addPluginModuleData($plugin_type_data);

    //drush_print_r($plugin_type_data);

    return $plugin_type_data;
  }
protected function gatherPluginTypeInfo ( $ job_list ) { // Assemble a basic array of plugin type data, that we will successively add // data to. $ plugin_type_data = array ( ) ; foreach ( $ job_list as $ job ) { $ plugin_manager_service_id = $ job [ 'service_id' ] ; $ plugin_type_id = $ job [ 'type_id' ] ; // Get the class name for the service. // Babysit modules that don't define services properly! // (I'm looking at Physical.) try { $ service = \ Drupal :: service ( $ plugin_manager_service_id ) ; } catch ( \ Throwable $ ex ) { continue ; } $ service = \ Drupal :: service ( $ plugin_manager_service_id ) ; $ service_class_name = get_class ( $ service ) ; $ service_component_namespace = $ this -> getClassComponentNamespace ( $ service_class_name ) ; $ plugin_type_data [ $ plugin_type_id ] = [ 'type_id' => $ plugin_type_id , 'service_id' => $ plugin_manager_service_id , 'service_class_name' => $ service_class_name , 'service_component_namespace' => $ service_component_namespace , // Plugin module may replace this if present. 'type_label' => $ plugin_type_id , ] ; // Add data from the plugin type manager service. // This gets us the subdirectory, interface, and annotation name. $ this -> addPluginTypeServiceData ( $ plugin_type_data [ $ plugin_type_id ] ) ; // Try to detect a base class for plugins $ this -> addPluginBaseClass ( $ plugin_type_data [ $ plugin_type_id ] ) ; // Try to detect a config schema prefix. $ this -> addConfigSchemaPrefix ( $ plugin_type_data [ $ plugin_type_id ] ) ; // Add data about the factory method of the base class, if any. $ this -> addConstructionData ( $ plugin_type_data [ $ plugin_type_id ] ) ; // Do the large arrays last, so they are last in the stored data so it's // easier to read. // Add data from the plugin annotation class. $ this -> addPluginAnnotationData ( $ plugin_type_data [ $ plugin_type_id ] ) ; // Add data from the plugin interface (which the manager service gave us). $ this -> addPluginMethods ( $ plugin_type_data [ $ plugin_type_id ] ) ; } // Get plugin type information if Plugin module is present. // We get data on all plugin types in one go, so this handles the whole // data. $ this -> addPluginModuleData ( $ plugin_type_data ) ; //drush_print_r($plugin_type_data); return $ plugin_type_data ; }
Detects information about plugin types from the plugin manager services.

@param $job_list
A numeric array whose values are arrays containing:
- 'service_id': The service ID of the plugin type manager.
- 'type_id': The derived ID of the plugin type.

@return
The assembled plugin type data. This is an array keyed by plugin type ID.
Values are arrays with the following properties:
- 'type_id': The plugin type ID. We take this to be the name of the
plugin manager service for that type, with the 'plugin.manager.'
prefix removed.
- 'type_label': A label for the plugin type. If Plugin module is present
then this is the label from the definition there, if found. Otherwise,
this duplicates the plugin type ID.
- 'service_id': The ID of the service for the plugin type's manager.
- 'discovery': The plugin's discovery class, as a fully-qualified
class name (without the initial '\').
- 'alter_hook_name': The short name of the alter hook for this plugin
type.
- 'subdir': The subdirectory of /src that plugin classes must go in.
E.g., 'Plugin/Filter'.
- 'plugin_interface': The interface that plugin classes must implement,
as a qualified name (but without initial '\').
- 'plugin_definition_annotation_name': The class that the plugin
annotation uses, as a qualified name (but without initial '\').
E.g, 'Drupal\filter\Annotation\Filter'.
- 'plugin_interface_methods': An array of methods that the plugin's
interface has. This is keyed by the method name, with each value an
array with these properties:
- 'name': The method name.
- 'declaration': The method declaration line from the interface.
- 'description': The text from the first line of the docblock.
- 'plugin_properties: Properties that the plugin class may declare in
its annotation. These are deduced from the class properties of the
plugin type's annotation class. An array keyed by the property name,
whose values are arrays with these properties:
- 'name': The name of the property.
- 'description': The description, taken from the docblock of the class
property on the annotation class.
- 'type': The data type.
- 'annotation_id_only': Boolean indicating whether the annotation
consists of only the plugin ID.
- 'construction': An array of injected service parameters for the plugin
base class. Each item has:
- 'type': The typehint.
- 'name': The parameter name, without the $.
- 'extraction': The code for getting the service from the container.
- 'constructor_fixed_parameters': An array of the fixed parameters for
plugin base class __construct(). This is only set if they differ from
the standard ones.
- 'type': The typehint.
- 'name': The parameter name, without the $.
- 'extraction': The code for getting the value to pass in from the
parameters passed to create().
- 'config_schema_prefix': The prefix to use for creating a config schema
ID for plugins of this type. The ID should be formed by appending the
plugin ID with a '.'.
- 'yaml_file_suffix': The suffix for YAML plugin files.
- 'yaml_properties': The default properties for plugins declared in YAML
files. An array whose keys are property names and values are the
default values.
- 'broken_plugins': (internal) An array of any plugins which could not
be correctly loaded. Keys are plugin IDs; values are a brief reason.

Due to the difficult nature of analysing the code for plugin types, some
of these properties may be empty if they could not be deduced.
Detects information about plugin types from the plugin manager services .