Make WordPress Core


Ignore:
Timestamp:
11/29/2022 03:49:49 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Always use parentheses when instantiating an object.

Note: This will be enforced by WPCS 3.0.0.

Props jrf.
See #56791.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/formatting/stripslashesDeep.php

    r53562 r54891  
    2727        $this->assertSame( array_values( $arr ), stripslashes_deep( array_values( $arr ) ) ); // Non-keyed.
    2828
    29         $obj = new stdClass;
     29        $obj = new stdClass();
    3030        foreach ( $arr as $k => $v ) {
    3131            $obj->$k = $v;
     
    4242        $this->assertSame( array( $new ), stripslashes_deep( array( $old ) ) ); // Non-keyed.
    4343
    44         $obj_old    = new stdClass;
     44        $obj_old    = new stdClass();
    4545        $obj_old->a = $old;
    46         $obj_new    = new stdClass;
     46        $obj_new    = new stdClass();
    4747        $obj_new->a = $new;
    4848        $this->assertEquals( $obj_new, stripslashes_deep( $obj_old ) );
Note: See TracChangeset for help on using the changeset viewer.