Make WordPress Core


Ignore:
Timestamp:
10/08/2020 09:13:57 PM (4 years ago)
Author:
SergeyBiryukov
Message:

General: Replace older-style PHP type conversion functions with type casts.

This improves performance, readability, and consistency throughout core.

  • intval()(int)
  • strval()(string)
  • floatval()(float)

Props ayeshrajans.
Fixes #42918.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/image/editorImagick.php

    r49025 r49108  
    556556
    557557        // The orientation value 3 is equivalent to rotated upside down (180 degrees).
    558         $this->assertSame( 3, intval( $data['orientation'] ), 'Orientation value read from does not match image file Exif data: ' . $file );
     558        $this->assertSame( 3, (int) $data['orientation'], 'Orientation value read from does not match image file Exif data: ' . $file );
    559559
    560560        $temp_file = wp_tempnam( $file );
     
    568568
    569569        // Make sure the image is no longer in The Upside Down Exif orientation.
    570         $this->assertSame( 1, intval( $data['orientation'] ), 'Orientation Exif data was not updated after rotating image: ' . $file );
     570        $this->assertSame( 1, (int) $data['orientation'], 'Orientation Exif data was not updated after rotating image: ' . $file );
    571571
    572572        // Remove both the generated file ending in .tmp and tmp.jpg due to wp_tempnam().
Note: See TracChangeset for help on using the changeset viewer.