JsCollectionRendererWrapper.php in Devel 4.x
File
webprofiler/src/Asset/JsCollectionRendererWrapper.php
View source
<?php
namespace Drupal\webprofiler\Asset;
use Drupal\Core\Asset\AssetCollectionRendererInterface;
use Drupal\webprofiler\DataCollector\AssetsDataCollector;
class JsCollectionRendererWrapper implements AssetCollectionRendererInterface {
private $assetCollectionRenderer;
private $dataCollector;
public function __construct(AssetCollectionRendererInterface $assetCollectionRenderer, AssetsDataCollector $dataCollector) {
$this->assetCollectionRenderer = $assetCollectionRenderer;
$this->dataCollector = $dataCollector;
}
public function render(array $js_assets) {
$this->dataCollector
->addJsAsset($js_assets);
return $this->assetCollectionRenderer
->render($js_assets);
}
}