/**
  * @param AssetInterface $asset
  * @param array $properties
  * @return array
  */
 public function getFilteredProperties(AssetInterface $asset, $properties = [])
 {
     $properties = array_filter($properties);
     $properties[self::PROPERTY_CONTENT_TYPE] = $asset->getContentType();
     $properties[self::PROPERTY_CAN_MERGE] = $asset instanceof MergeableInterface;
     return $properties;
 }
Esempio n. 2
0
 /**
  * Returns minifier decorator class name for given asset
  *
  * @param AssetInterface $asset
  * @param bool $isDirectRequest
  * @return string
  */
 protected function getDecoratorClass(AssetInterface $asset, $isDirectRequest)
 {
     if ($isDirectRequest || $asset->getContentType() == 'css') {
         $result = 'Magento\\Framework\\View\\Asset\\Minified\\ImmutablePathAsset';
     } else {
         $result = 'Magento\\Framework\\View\\Asset\\Minified\\MutablePathAsset';
     }
     return $result;
 }