diff --git a/core/modules/image/image.module b/core/modules/image/image.module index ee41eaa800..b9609a1719 100644 --- a/core/modules/image/image.module +++ b/core/modules/image/image.module @@ -576,12 +576,12 @@ function image_form_editor_image_dialog_validate(array &$form, FormStateInterfac if ($image_style) { $image_style->transformDimensions($dimensions, $attributes['src']); $attributes['width'] = $dimensions['width']; - $attributes['height'] = $dimensions['height']; + $attributes['height'] = $dimensions['height']; } else { - // We must explicitely set to NULL (and not unset) for CKEditor to take + // We must explicitly set to NULL (and not unset) for CKEditor to take // the change into account. - foreach(['width','height','data-image-style'] as $key) { + foreach (['width', 'height', 'data-image-style'] as $key) { $attributes[$key] = NULL; } } diff --git a/core/modules/image/image.post_update.php b/core/modules/image/image.post_update.php index 6af171fbad..395d995958 100644 --- a/core/modules/image/image.post_update.php +++ b/core/modules/image/image.post_update.php @@ -5,6 +5,7 @@ * Post-update functions for Image. */ +use Drupal\Core\Config\Entity\ConfigEntityUpdater; use Drupal\filter\FilterFormatInterface; /** diff --git a/core/modules/image/tests/src/Functional/FilterImageStyleTest.php b/core/modules/image/tests/src/Functional/FilterImageStyleTest.php index 7e4f2277a3..dc60f6e5b1 100644 --- a/core/modules/image/tests/src/Functional/FilterImageStyleTest.php +++ b/core/modules/image/tests/src/Functional/FilterImageStyleTest.php @@ -36,7 +36,7 @@ class FilterImageStyleTest extends BrowserTestBase { /** * Tasks common to all tests. */ - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->format = FilterFormat::create([ @@ -116,7 +116,7 @@ public function testImageStyle() { $image_element = $this->getSession()->getPage()->find('css', 'img[data-entity-uuid="' . $file->uuid() . '"]'); $this->assertNotEmpty($image_element); - $this->assertContains('medium', $image_element->getAttribute('src')); + $this->assertStringContainsString('medium', $image_element->getAttribute('src')); $this->assertEquals('220', $image_element->getAttribute('width')); $this->assertEquals('164', $image_element->getAttribute('height')); } diff --git a/core/modules/image/tests/src/FunctionalJavascript/AddImageTest.php b/core/modules/image/tests/src/FunctionalJavascript/AddImageTest.php index fcb5b9eb28..08f29710eb 100644 --- a/core/modules/image/tests/src/FunctionalJavascript/AddImageTest.php +++ b/core/modules/image/tests/src/FunctionalJavascript/AddImageTest.php @@ -30,7 +30,7 @@ class AddImageTest extends WebDriverTestBase { /** * {@inheritdoc} */ - protected function setUp() { + protected function setUp(): void { parent::setUp(); FilterFormat::create([ @@ -101,7 +101,7 @@ public function testDataImageStyleElement() { $this->assertNotEmpty($source_button); $source_button->click(); - $this->assertContains('data-image-style="thumbnail"', $page->find('css', 'textarea.cke_source')->getValue()); + $this->assertStringContainsString('data-image-style="thumbnail"', $page->find('css', 'textarea.cke_source')->getValue()); } } diff --git a/core/modules/image/tests/src/Kernel/EditorImageStyleDialogTest.php b/core/modules/image/tests/src/Kernel/EditorImageStyleDialogTest.php index ed3fb1c245..342ede64a5 100644 --- a/core/modules/image/tests/src/Kernel/EditorImageStyleDialogTest.php +++ b/core/modules/image/tests/src/Kernel/EditorImageStyleDialogTest.php @@ -47,7 +47,7 @@ class EditorImageStyleDialogTest extends EntityKernelTestBase { /** * {@inheritdoc} */ - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->installEntitySchema('file');