Make WordPress Core


Ignore:
Timestamp:
08/03/2023 12:08:30 PM (14 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use instanceof keyword instead of the is_a() function.

This is a micro-optimization that removes a few unnecessary function calls.

Follow-up to [31188], [34369], [38986], [41159], [43211], [43230], [44606], [45757].

Props ayeshrajans, jrf, rajinsharwar, costdev, mukesh27, SergeyBiryukov.
Fixes #58943.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/testcase-rest-api.php

    r50283 r56352  
    44    protected function assertErrorResponse( $code, $response, $status = null ) {
    55
    6         if ( is_a( $response, 'WP_REST_Response' ) ) {
     6        if ( $response instanceof WP_REST_Response ) {
    77            $response = $response->as_error();
    88        }
Note: See TracChangeset for help on using the changeset viewer.