public function ProcessDecorator::__construct

Constructs a \Drupal\Component\Plugin\Discovery\ProcessDecorator object.

Parameters

\Drupal\Component\Plugin\Discovery\DiscoveryInterface $decorated: The discovery object that is being decorated.

callable $process_callback: The processor callback to run on each discovered definition. The callback will be called with the following arguments:

  • array $definition: the discovered definition, that the callback should accept by reference and modify in place.
  • string $plugin_id: the corresponding plugin_id.

File

drupal/core/lib/Drupal/Component/Plugin/Discovery/ProcessDecorator.php, line 44
Contains \Drupal\Component\Plugin\Discovery\ProcessDecorator.

Class

ProcessDecorator
Allows custom processing of the discovered definition.

Namespace

Drupal\Component\Plugin\Discovery

Code

public function __construct(DiscoveryInterface $decorated, $process_callback) {
  $this->decorated = $decorated;
  $this->processCallback = $process_callback;
}