You are here

class JsCollectionRendererWrapper in Devel 4.x

Same name and namespace in other branches
  1. 8.3 webprofiler/src/Asset/JsCollectionRendererWrapper.php \Drupal\webprofiler\Asset\JsCollectionRendererWrapper
  2. 8 webprofiler/src/Asset/JsCollectionRendererWrapper.php \Drupal\webprofiler\Asset\JsCollectionRendererWrapper
  3. 8.2 webprofiler/src/Asset/JsCollectionRendererWrapper.php \Drupal\webprofiler\Asset\JsCollectionRendererWrapper

Class JsCollectionRendererWrapper.

Hierarchy

Expanded class hierarchy of JsCollectionRendererWrapper

1 string reference to 'JsCollectionRendererWrapper'
webprofiler.services.yml in webprofiler/webprofiler.services.yml
webprofiler/webprofiler.services.yml
1 service uses JsCollectionRendererWrapper
webprofiler.debug.asset.js.collection_renderer in webprofiler/webprofiler.services.yml
Drupal\webprofiler\Asset\JsCollectionRendererWrapper

File

webprofiler/src/Asset/JsCollectionRendererWrapper.php, line 11

Namespace

Drupal\webprofiler\Asset
View source
class JsCollectionRendererWrapper implements AssetCollectionRendererInterface {

  /**
   * @var \Drupal\Core\Asset\AssetCollectionRendererInterface
   */
  private $assetCollectionRenderer;

  /**
   * @var \Drupal\webprofiler\DataCollector\AssetsDataCollector
   */
  private $dataCollector;

  /**
   * @param \Drupal\Core\Asset\AssetCollectionRendererInterface $assetCollectionRenderer
   * @param \Drupal\webprofiler\DataCollector\AssetsDataCollector $dataCollector
   */
  public function __construct(AssetCollectionRendererInterface $assetCollectionRenderer, AssetsDataCollector $dataCollector) {
    $this->assetCollectionRenderer = $assetCollectionRenderer;
    $this->dataCollector = $dataCollector;
  }

  /**
   * {@inheritdoc}
   */
  public function render(array $js_assets) {
    $this->dataCollector
      ->addJsAsset($js_assets);
    return $this->assetCollectionRenderer
      ->render($js_assets);
  }

}

Members