Skip to content

Commit 67dee59

Browse files
committed
Suppress imagedestroy() phpcs complaints
1 parent 8f351e9 commit 67dee59

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

plugins/webp-uploads/hooks.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ function webp_uploads_convert_palette_png_to_truecolor( $file ): array {
947947

948948
// Check if the image is already truecolor.
949949
if ( imageistruecolor( $image ) ) {
950-
imagedestroy( $image );
950+
imagedestroy( $image ); // phpcs:ignore Generic.PHP.DeprecatedFunctions.Deprecated
951951
return $file;
952952
}
953953

@@ -960,7 +960,7 @@ function webp_uploads_convert_palette_png_to_truecolor( $file ): array {
960960
// Overwrite the upload with the new truecolor PNG.
961961
imagepng( $image, $file['tmp_name'] );
962962
}
963-
imagedestroy( $image );
963+
imagedestroy( $image ); // phpcs:ignore Generic.PHP.DeprecatedFunctions.Deprecated
964964

965965
return $file;
966966
}

plugins/webp-uploads/tests/test-load.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,7 @@ static function () {
11901190
$this->assertNotSame( $original_file_hash, $modified_file_hash );
11911191
$img = imagecreatefrompng( $path );
11921192
$this->assertTrue( imageistruecolor( $img ) );
1193-
imagedestroy( $img );
1193+
imagedestroy( $img ); // phpcs:ignore Generic.PHP.DeprecatedFunctions.Deprecated
11941194

11951195
// Make sure the image converted to modern image format is not 0 bytes.
11961196
$modern_image_format_path = get_attached_file( $attachment_id );

0 commit comments

Comments
 (0)