Commit 44986fef authored by catch's avatar catch
Browse files

Issue #2973509 by claudiu.cristea, tahirmus, alexpott: Image media source uses...

Issue #2973509 by claudiu.cristea, tahirmus, alexpott: Image media source uses FileSystem class instead of FileSystemInterface for type hinting
parent d95a6b00
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
use Drupal\Core\Config\Config; use Drupal\Core\Config\Config;
use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\File\FileSystemInterface;
use Drupal\Core\Lock\LockBackendInterface; use Drupal\Core\Lock\LockBackendInterface;
use Drupal\Core\Session\AccountInterface; use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Utility\Token; use Drupal\Core\Utility\Token;
...@@ -15,7 +16,6 @@ ...@@ -15,7 +16,6 @@
use Drupal\rest\Plugin\ResourceBase; use Drupal\rest\Plugin\ResourceBase;
use Drupal\Component\Render\PlainTextOutput; use Drupal\Component\Render\PlainTextOutput;
use Drupal\Core\Entity\EntityFieldManagerInterface; use Drupal\Core\Entity\EntityFieldManagerInterface;
use Drupal\Core\File\FileSystem;
use Drupal\file\Entity\File; use Drupal\file\Entity\File;
use Drupal\rest\Plugin\rest\resource\EntityResourceValidationTrait; use Drupal\rest\Plugin\rest\resource\EntityResourceValidationTrait;
use Drupal\rest\RequestHandler; use Drupal\rest\RequestHandler;
...@@ -73,7 +73,7 @@ class FileUploadResource extends ResourceBase { ...@@ -73,7 +73,7 @@ class FileUploadResource extends ResourceBase {
/** /**
* The file system service. * The file system service.
* *
* @var \Drupal\Core\File\FileSystem * @var \Drupal\Core\File\FileSystemInterface
*/ */
protected $fileSystem; protected $fileSystem;
...@@ -137,7 +137,7 @@ class FileUploadResource extends ResourceBase { ...@@ -137,7 +137,7 @@ class FileUploadResource extends ResourceBase {
* The available serialization formats. * The available serialization formats.
* @param \Psr\Log\LoggerInterface $logger * @param \Psr\Log\LoggerInterface $logger
* A logger instance. * A logger instance.
* @param \Drupal\Core\File\FileSystem $file_system * @param \Drupal\Core\File\FileSystemInterface $file_system
* The file system service. * The file system service.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager. * The entity type manager.
...@@ -154,7 +154,7 @@ class FileUploadResource extends ResourceBase { ...@@ -154,7 +154,7 @@ class FileUploadResource extends ResourceBase {
* @param \Drupal\Core\Config\Config $system_file_config * @param \Drupal\Core\Config\Config $system_file_config
* The system file configuration. * The system file configuration.
*/ */
public function __construct(array $configuration, $plugin_id, $plugin_definition, $serializer_formats, LoggerInterface $logger, FileSystem $file_system, EntityTypeManagerInterface $entity_type_manager, EntityFieldManagerInterface $entity_field_manager, AccountInterface $current_user, MimeTypeGuesserInterface $mime_type_guesser, Token $token, LockBackendInterface $lock, Config $system_file_config) { public function __construct(array $configuration, $plugin_id, $plugin_definition, $serializer_formats, LoggerInterface $logger, FileSystemInterface $file_system, EntityTypeManagerInterface $entity_type_manager, EntityFieldManagerInterface $entity_field_manager, AccountInterface $current_user, MimeTypeGuesserInterface $mime_type_guesser, Token $token, LockBackendInterface $lock, Config $system_file_config) {
parent::__construct($configuration, $plugin_id, $plugin_definition, $serializer_formats, $logger); parent::__construct($configuration, $plugin_id, $plugin_definition, $serializer_formats, $logger);
$this->fileSystem = $file_system; $this->fileSystem = $file_system;
$this->entityTypeManager = $entity_type_manager; $this->entityTypeManager = $entity_type_manager;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
use Drupal\Core\Entity\EntityFieldManagerInterface; use Drupal\Core\Entity\EntityFieldManagerInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Field\FieldTypePluginManagerInterface; use Drupal\Core\Field\FieldTypePluginManagerInterface;
use Drupal\Core\File\FileSystem; use Drupal\Core\File\FileSystemInterface;
use Drupal\Core\Image\ImageFactory; use Drupal\Core\Image\ImageFactory;
use Drupal\media\MediaInterface; use Drupal\media\MediaInterface;
use Drupal\media\MediaTypeInterface; use Drupal\media\MediaTypeInterface;
...@@ -51,7 +51,7 @@ class Image extends File { ...@@ -51,7 +51,7 @@ class Image extends File {
/** /**
* The file system service. * The file system service.
* *
* @var \Drupal\Core\File\FileSystem * @var \Drupal\Core\File\FileSystemInterface
*/ */
protected $fileSystem; protected $fileSystem;
...@@ -74,10 +74,10 @@ class Image extends File { ...@@ -74,10 +74,10 @@ class Image extends File {
* The config factory service. * The config factory service.
* @param \Drupal\Core\Image\ImageFactory $image_factory * @param \Drupal\Core\Image\ImageFactory $image_factory
* The image factory. * The image factory.
* @param \Drupal\Core\File\FileSystem $file_system * @param \Drupal\Core\File\FileSystemInterface $file_system
* The file system service. * The file system service.
*/ */
public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, EntityFieldManagerInterface $entity_field_manager, FieldTypePluginManagerInterface $field_type_manager, ConfigFactoryInterface $config_factory, ImageFactory $image_factory, FileSystem $file_system) { public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, EntityFieldManagerInterface $entity_field_manager, FieldTypePluginManagerInterface $field_type_manager, ConfigFactoryInterface $config_factory, ImageFactory $image_factory, FileSystemInterface $file_system) {
parent::__construct($configuration, $plugin_id, $plugin_definition, $entity_type_manager, $entity_field_manager, $field_type_manager, $config_factory); parent::__construct($configuration, $plugin_id, $plugin_definition, $entity_type_manager, $entity_field_manager, $field_type_manager, $config_factory);
$this->imageFactory = $image_factory; $this->imageFactory = $image_factory;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
class FileSystemTest extends UnitTestCase { class FileSystemTest extends UnitTestCase {
/** /**
* @var \Drupal\Core\File\FileSystem * @var \Drupal\Core\File\FileSystemInterface
*/ */
protected $fileSystem; protected $fileSystem;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment