diff --git a/core/modules/file/src/Plugin/Field/FieldFormatter/FileFormatterBase.php b/core/modules/file/src/Plugin/Field/FieldFormatter/FileFormatterBase.php index 69bde9c..cdd5b7b 100644 --- a/core/modules/file/src/Plugin/Field/FieldFormatter/FileFormatterBase.php +++ b/core/modules/file/src/Plugin/Field/FieldFormatter/FileFormatterBase.php @@ -7,11 +7,8 @@ namespace Drupal\file\Plugin\Field\FieldFormatter; -use Drupal\Core\Entity\EntityStorageInterface; -use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceFormatterBase; use Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem; -use Drupal\file\FileStorageInterface; /** * Base class for file formatters. diff --git a/core/modules/file/src/Tests/CopyTest.php b/core/modules/file/src/Tests/CopyTest.php index 56d74a3..3556b93 100644 --- a/core/modules/file/src/Tests/CopyTest.php +++ b/core/modules/file/src/Tests/CopyTest.php @@ -40,8 +40,7 @@ function testNormal() { // Reload the file from the database and check that the changes were // actually saved. - $fid = $result->id(); - $this->assertFileUnchanged($result, $file_storage->load($fid)); + $this->assertFileUnchanged($result, $file_storage->load($result->id())); } /** diff --git a/core/modules/file/src/Tests/FileFieldTestBase.php b/core/modules/file/src/Tests/FileFieldTestBase.php index 802310b..4e8547b 100644 --- a/core/modules/file/src/Tests/FileFieldTestBase.php +++ b/core/modules/file/src/Tests/FileFieldTestBase.php @@ -40,8 +40,10 @@ function getTestFile($type_name, $size = NULL) { // Get a file to upload. $file = current($this->drupalGetTestFiles($type_name, $size)); - // Add a filesize property to files as would be read by - // \Drupal\Core\Entity\EntityInterface::load(). + /** + * Add a filesize property to files as would be read by + * \Drupal\Core\Entity\EntityInterface::load(). + */ $file->filesize = filesize($file->uri); return entity_create('file', (array) $file); diff --git a/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php b/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php index e8b81ef..2b4b31f 100644 --- a/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php +++ b/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php @@ -66,11 +66,9 @@ class ImageFormatter extends ImageFormatterBase implements ContainerFactoryPlugi * The current user. * @param \Drupal\Core\Utility\LinkGeneratorInterface $link_generator * The link generator service. - * @param \Drupal\file\FileStorageInterface $file_storage - * The file storage. */ - public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, AccountInterface $current_user, LinkGeneratorInterface $link_generator, FileStorageInterface $file_storage) { - parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings, $file_storage); + public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, AccountInterface $current_user, LinkGeneratorInterface $link_generator) { + parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings); $this->currentUser = $current_user; $this->linkGenerator = $link_generator; } diff --git a/core/modules/rdf/src/Tests/FileFieldAttributesTest.php b/core/modules/rdf/src/Tests/FileFieldAttributesTest.php index ec13e4d..5ae4926 100644 --- a/core/modules/rdf/src/Tests/FileFieldAttributesTest.php +++ b/core/modules/rdf/src/Tests/FileFieldAttributesTest.php @@ -70,8 +70,6 @@ protected function setUp() { $this->node = $node_storage->load($nid); $file_storage = $this->container->get('entity.manager')->getStorage('file'); $this->file = $file_storage->load($this->node->{$this->fieldName}->target_id); - - } /** diff --git a/core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php b/core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php index 46dd338..da3b9c9 100644 --- a/core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php +++ b/core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php @@ -54,13 +54,11 @@ class ResponsiveImageFormatter extends ImageFormatterBase implements ContainerFa * The view mode. * @param array $third_party_settings * Any third party settings. - * @param \Drupal\file\FileStorageInterface $file_storage - * The file storage. * @param \Drupal\Core\Entity\EntityStorageInterface $responsive_image_style_storage * The responsive image style storage. */ - public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, FileStorageInterface $file_storage, EntityStorageInterface $responsive_image_style_storage) { - parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings, $file_storage); + public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, EntityStorageInterface $responsive_image_style_storage) { + parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings, $responsive_image_style_storage); $this->responsiveImageStyleStorage = $responsive_image_style_storage; }