From 3c18bb9cd301047fa16f5acb007b4d002d01d50b Mon Sep 17 00:00:00 2001 From: Maxime Rainville Date: Thu, 2 May 2024 23:05:27 +1200 Subject: [PATCH] Undo linting --- src/Shortcodes/ImageShortcodeProvider.php | 14 ++++++-------- tests/php/ImageManipulationTest.php | 10 +++++----- .../php/Shortcodes/ImageShortcodeProviderTest.php | 14 +++++--------- 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/src/Shortcodes/ImageShortcodeProvider.php b/src/Shortcodes/ImageShortcodeProvider.php index ccdbe1c8..0f5bbd6b 100644 --- a/src/Shortcodes/ImageShortcodeProvider.php +++ b/src/Shortcodes/ImageShortcodeProvider.php @@ -202,7 +202,7 @@ public static function regenerate_shortcode($args, $content, $parser, $shortcode /** * Helper method to regenerate all shortcode links. * - * @param string $value HTML value + * @param string $value HTML value * @return string value with links resampled */ public static function regenerate_html_links($value) @@ -227,11 +227,9 @@ public static function getCache() */ protected static function find_error_record($errorCode) { - return Image::create( - [ + return Image::create([ 'Title' => _t(__CLASS__ . '.IMAGENOTFOUND', 'Image not found'), - ] - ); + ]); } /** @@ -239,9 +237,9 @@ protected static function find_error_record($errorCode) * Eager-load is the default browser behaviour so when eager loading is specified, the * loading attribute is omitted * - * @param array $args - * @param int|null $width - * @param int|null $height + * @param array $args + * @param int|null $width + * @param int|null $height * @return array */ private static function updateLoadingValue(array $args, ?int $width, ?int $height): array diff --git a/tests/php/ImageManipulationTest.php b/tests/php/ImageManipulationTest.php index 5994b19c..0f966f35 100644 --- a/tests/php/ImageManipulationTest.php +++ b/tests/php/ImageManipulationTest.php @@ -212,10 +212,10 @@ public function testGetAttributesWhenLazyLoadIsDisabled() $this->assertEquals( [ - 'width' => $image->getWidth(), - 'height' => $image->getHeight(), - 'alt' => $image->getTitle(), - 'src' => $image->getURL(), + 'width' => $image->getWidth(), + 'height' => $image->getHeight(), + 'alt' => $image->getTitle(), + 'src' => $image->getURL(), ], $image->getAttributes(), 'No loading attribute when lazy loading is disabled globally' @@ -275,7 +275,7 @@ public function testIsLazyLoaded() public function testAttributesHTML() { - /** @var Image $origin*/ + /** @var Image $origin */ $image = $this->objFromFixture(Image::class, 'imageWithTitle'); $this->assertEquals( 'width="300" height="300" alt="This is a image Title" src="/assets/ImageTest/folder/test-image.png" loading="lazy"', diff --git a/tests/php/Shortcodes/ImageShortcodeProviderTest.php b/tests/php/Shortcodes/ImageShortcodeProviderTest.php index 2bb423fc..a741d5f4 100644 --- a/tests/php/Shortcodes/ImageShortcodeProviderTest.php +++ b/tests/php/Shortcodes/ImageShortcodeProviderTest.php @@ -31,9 +31,7 @@ protected function setUp(): void // Copy test images for each of the fixture references $images = Image::get(); - /** - * @var Image $image -*/ + /** @var Image $image */ foreach ($images as $image) { $sourcePath = __DIR__ . '/../ImageTest/' . $image->Name; $image->setFromLocalFile($sourcePath, $image->Filename); @@ -89,12 +87,10 @@ public function testShorcodeRegenrator() $image->ID, $image->Link() ), - $parser->parse( - sprintf( - '[image id="%d" alt="My alt text" title="My Title & special character"]', - $image->ID - ) - ), + $parser->parse(sprintf( + '[image id="%d" alt="My alt text" title="My Title & special character"]', + $image->ID + )), 'Shortcode regeneration properly reads attributes' );