Skip to content
Snippets Groups Projects

3454516: Replace FileSystem injection with FileSystemInterface to allow for decorators.

1 file
+ 3
2
Compare changes
  • Side-by-side
  • Inline
@@ -4,6 +4,7 @@ namespace Drupal\csvfile_formatter\Plugin\Field\FieldFormatter;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\File\FileSystemInterface;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\file\Plugin\Field\FieldFormatter\FileFormatterBase;
use Drupal\Core\Link;
@@ -29,7 +30,7 @@ class CSVFileFormatter extends FileFormatterBase {
/**
* Inject file_system service.
*
* @var \Drupal\Core\File\FileSystem
* @var \Drupal\Core\File\FileSystemInterface
*/
protected $fileSystem;
@@ -92,7 +93,7 @@ class CSVFileFormatter extends FileFormatterBase {
/**
* {@inheritdoc}
*/
public function __construct($plugin_id, $plugin_definition, $field_definition, array $settings, $label, $view_mode, array $third_party_settings, FileSystem $file_system, ConfigFactoryInterface $config_factory, RequestStack $request_stack) {
public function __construct($plugin_id, $plugin_definition, $field_definition, array $settings, $label, $view_mode, array $third_party_settings, FileSystemInterface $file_system, ConfigFactoryInterface $config_factory, RequestStack $request_stack) {
parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
$this->setFileSystem($file_system);
$this->setConfigFactory($config_factory);
Loading