Skip to content
Snippets Groups Projects

Issue #3496505: Fixing more static analysis issues, and ignoring those...

Merged Issue #3496505: Fixing more static analysis issues, and ignoring those...
Merged Lisa Harrison requested to merge 3496496-3 into 2.3.x
6 files
+ 117
3
Compare changes
  • Side-by-side
  • Inline
Files
6
+ 20
1
@@ -4,6 +4,7 @@ namespace Drupal\flysystem\Asset;
use Drupal\Component\Utility\Crypt;
use Drupal\Core\Asset\AssetDumper as DrupalAssetDumper;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\File\FileSystemInterface;
use Drupal\Core\File\FileExists;
@@ -16,6 +17,24 @@ class AssetDumper extends DrupalAssetDumper {
use SchemeExtensionTrait;
/**
* Drupal Config factory service.
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
protected $configFactory;
/**
* AssetDumper constructor.
*
* @param \Drupal\Core\File\FileSystemInterface $file_system
* The file handler.
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* Drupal Config factory service.
*/
public function __construct(FileSystemInterface $file_system, ConfigFactoryInterface $config_factory) {
$this->fileSystem = $file_system;
$this->configFactory = $config_factory;
}
/**
* {@inheritdoc}
*/
@@ -39,7 +58,7 @@ class AssetDumper extends DrupalAssetDumper {
// file) in generating the file anyway. Sites on servers where rewrite rules
// aren't working can set css.gzip to FALSE in order to skip
// generating a file that won't be used.
if (extension_loaded('zlib') && \Drupal::config('system.performance')->get($file_extension . '.gzip')) {
if (extension_loaded('zlib') && $this->configFactory->get('system.performance')->get($file_extension . '.gzip')) {
if (!file_exists($uri . '.gz') && !$this->fileSystem->saveData(gzencode($data, 9, FORCE_GZIP), $uri . '.gz', FileExists::Replace)) {
return FALSE;
}
Loading