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/rest-api/rest-block-type-controller.php

    r54670 r54891  
    625625     */
    626626    public function test_prepare_item() {
    627         $registry = new WP_Block_Type_Registry;
     627        $registry = new WP_Block_Type_Registry();
    628628        $settings = array(
    629629            'icon'            => 'text',
     
    632632        $registry->register( 'fake/line', $settings );
    633633        $block_type = $registry->get_registered( 'fake/line' );
    634         $endpoint   = new WP_REST_Block_Types_Controller;
    635         $request    = new WP_REST_Request;
     634        $endpoint   = new WP_REST_Block_Types_Controller();
     635        $request    = new WP_REST_Request();
    636636        $request->set_param( 'context', 'edit' );
    637637        $response = $endpoint->prepare_item_for_response( $block_type, $request );
     
    643643     */
    644644    public function test_prepare_item_limit_fields() {
    645         $registry = new WP_Block_Type_Registry;
     645        $registry = new WP_Block_Type_Registry();
    646646        $settings = array(
    647647            'icon'            => 'text',
     
    650650        $registry->register( 'fake/line', $settings );
    651651        $block_type = $registry->get_registered( 'fake/line' );
    652         $request    = new WP_REST_Request;
    653         $endpoint   = new WP_REST_Block_Types_Controller;
     652        $request    = new WP_REST_Request();
     653        $endpoint   = new WP_REST_Block_Types_Controller();
    654654        $request->set_param( 'context', 'edit' );
    655655        $request->set_param( '_fields', 'name' );
Note: See TracChangeset for help on using the changeset viewer.