Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (6 years ago)
Author:
pento
Message:

Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/testcase-rest-post-type-controller.php

    r40108 r42343  
    160160        if ( $links ) {
    161161
    162             $links = test_rest_expand_compact_links( $links );
     162            $links     = test_rest_expand_compact_links( $links );
    163163            $post_type = get_post_type_object( $data['type'] );
    164164            $this->assertEquals( $links['self'][0]['href'], rest_url( 'wp/v2/' . $post_type->rest_base . '/' . $data['id'] ) );
     
    217217            foreach ( $links as &$links_array ) {
    218218                foreach ( $links_array as &$link ) {
    219                     $attributes = array_diff_key( $link, array( 'href' => 1, 'name' => 1 ) );
    220                     $link = array_diff_key( $link, $attributes );
     219                    $attributes         = array_diff_key(
     220                        $link, array(
     221                            'href' => 1,
     222                            'name' => 1,
     223                        )
     224                    );
     225                    $link               = array_diff_key( $link, $attributes );
    221226                    $link['attributes'] = $attributes;
    222227                }
     
    279284
    280285    protected function set_raw_post_data( $args = array() ) {
    281         return wp_parse_args( $args, $this->set_post_data( array(
    282             'title'   => array(
    283                 'raw' => 'Post Title',
    284             ),
    285             'content' => array(
    286                 'raw' => 'Post content',
    287             ),
    288             'excerpt' => array(
    289                 'raw' => 'Post excerpt',
    290             ),
    291         ) ) );
     286        return wp_parse_args(
     287            $args, $this->set_post_data(
     288                array(
     289                    'title'   => array(
     290                        'raw' => 'Post Title',
     291                    ),
     292                    'content' => array(
     293                        'raw' => 'Post content',
     294                    ),
     295                    'excerpt' => array(
     296                        'raw' => 'Post excerpt',
     297                    ),
     298                )
     299            )
     300        );
    292301    }
    293302
Note: See TracChangeset for help on using the changeset viewer.