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