Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (9 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/tests/rest-api/rest-test-controller.php

    r38832 r42343  
    1919        public function get_item_schema() {
    2020                $schema = array(
    21                         '$schema'              => 'http://json-schema.org/draft-04/schema#',
    22                         'title'                => 'type',
    23                         'type'                 => 'object',
    24                         'properties'           => array(
    25                                 'somestring'       => array(
    26                                         'type'         => 'string',
    27                                         'description'  => 'A pretty string.',
    28                                         'context'      => array( 'view' ),
     21                        '$schema'    => 'http://json-schema.org/draft-04/schema#',
     22                        'title'      => 'type',
     23                        'type'       => 'object',
     24                        'properties' => array(
     25                                'somestring'     => array(
     26                                        'type'        => 'string',
     27                                        'description' => 'A pretty string.',
     28                                        'context'     => array( 'view' ),
    2929                                ),
    30                                 'someinteger'      => array(
    31                                         'type'         => 'integer',
    32                                         'context'      => array( 'view' ),
     30                                'someinteger'    => array(
     31                                        'type'    => 'integer',
     32                                        'context' => array( 'view' ),
    3333                                ),
    34                                 'someboolean'      => array(
    35                                         'type'         => 'boolean',
    36                                         'context'      => array( 'view' ),
     34                                'someboolean'    => array(
     35                                        'type'    => 'boolean',
     36                                        'context' => array( 'view' ),
    3737                                ),
    38                                 'someurl'          => array(
    39                                         'type'         => 'string',
    40                                         'format'       => 'uri',
    41                                         'context'      => array( 'view' ),
     38                                'someurl'        => array(
     39                                        'type'    => 'string',
     40                                        'format'  => 'uri',
     41                                        'context' => array( 'view' ),
    4242                                ),
    43                                 'somedate'             => array(
    44                                         'type'         => 'string',
    45                                         'format'       => 'date-time',
    46                                         'context'      => array( 'view' ),
     43                                'somedate'       => array(
     44                                        'type'    => 'string',
     45                                        'format'  => 'date-time',
     46                                        'context' => array( 'view' ),
    4747                                ),
    48                                 'someemail'             => array(
    49                                         'type'         => 'string',
    50                                         'format'       => 'email',
    51                                         'context'      => array( 'view' ),
     48                                'someemail'      => array(
     49                                        'type'    => 'string',
     50                                        'format'  => 'email',
     51                                        'context' => array( 'view' ),
    5252                                ),
    53                                 'someenum'         => array(
    54                                         'type'         => 'string',
    55                                         'enum'         => array( 'a', 'b', 'c' ),
    56                                         'context'      => array( 'view' ),
     53                                'someenum'       => array(
     54                                        'type'    => 'string',
     55                                        'enum'    => array( 'a', 'b', 'c' ),
     56                                        'context' => array( 'view' ),
    5757                                ),
    58                                 'someargoptions'   => array(
    59                                         'type'         => 'integer',
    60                                         'required'     => true,
    61                                         'arg_options'  => array(
     58                                'someargoptions' => array(
     59                                        'type'        => 'integer',
     60                                        'required'    => true,
     61                                        'arg_options' => array(
    6262                                                'required'          => false,
    6363                                                'sanitize_callback' => '__return_true',
    6464                                        ),
    6565                                ),
    66                                 'somedefault'      => array(
    67                                         'type'         => 'string',
    68                                         'enum'         => array( 'a', 'b', 'c' ),
    69                                         'context'      => array( 'view' ),
    70                                         'default'      => 'a',
     66                                'somedefault'    => array(
     67                                        'type'    => 'string',
     68                                        'enum'    => array( 'a', 'b', 'c' ),
     69                                        'context' => array( 'view' ),
     70                                        'default' => 'a',
    7171                                ),
    7272                        ),
Note: See TracChangeset for help on using the changeset viewer.