Making WordPress.org


Ignore:
Timestamp:
12/19/2017 04:22:37 PM (9 years ago)
Author:
obenland
Message:

PLugins: Clean up formatting with phpcbf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin-support-reps.php

    r5930 r6287  
    11<?php
    22namespace WordPressdotorg\Plugin_Directory\API\Routes;
     3
    34use WordPressdotorg\Plugin_Directory\Plugin_Directory;
    45use WordPressdotorg\Plugin_Directory\Template;
    … …  
    2021                register_rest_route( 'plugins/v1', '/plugin/(?P<plugin_slug>[^/]+)/support-reps/?', array(
    2122                        array(
    22                                 'methods'  => WP_REST_Server::READABLE,
    23                                 'callback' => array( $this, 'list_support_reps' ),
     23                                'methods'             => WP_REST_Server::READABLE,
     24                                'callback'            => array( $this, 'list_support_reps' ),
    2425                                'permission_callback' => function( $request ) {
    2526                                        return current_user_can(
    … …  
    2829                                        );
    2930                                },
    30                                 'args' => array(
     31                                'args'                => array(
    3132                                        'plugin_slug' => array(
    3233                                                'validate_callback' => array( $this, 'validate_plugin_slug_callback' ),
    33                                                 'required' => true,
     34                                                'required'          => true,
    3435                                        ),
    35                                 )
     36                                ),
    3637                        ),
    3738                        array(
    38                                 'methods'  => WP_REST_Server::CREATABLE,
    39                                 'callback' => array( $this, 'add_support_rep' ),
     39                                'methods'             => WP_REST_Server::CREATABLE,
     40                                'callback'            => array( $this, 'add_support_rep' ),
    4041                                'permission_callback' => function( $request ) {
    4142                                        return current_user_can(
    … …  
    4445                                        );
    4546                                },
    46                                 'args' => array(
     47                                'args'                => array(
    4748                                        'plugin_slug' => array(
    4849                                                'validate_callback' => array( $this, 'validate_plugin_slug_callback' ),
    49                                                 'required' => true,
     50                                                'required'          => true,
    5051                                        ),
    51                                 )
    52                         )
     52                                ),
     53                        ),
    5354                ) );
    5455
    5556                register_rest_route( 'plugins/v1', '/plugin/(?P<plugin_slug>[^/]+)/support-reps/(?P<support_rep>[^/]+)/?', array(
    56                         'methods'  => WP_REST_Server::DELETABLE,
    57                         'callback' => array( $this, 'remove_support_rep' ),
     57                        'methods'             => WP_REST_Server::DELETABLE,
     58                        'callback'            => array( $this, 'remove_support_rep' ),
    5859                        'permission_callback' => function( $request ) {
    5960                                return current_user_can(
    … …  
    6263                                );
    6364                        },
    64                         'args' => array(
     65                        'args'                => array(
    6566                                'plugin_slug' => array(
    6667                                        'validate_callback' => array( $this, 'validate_plugin_slug_callback' ),
    67                                         'required' => true,
     68                                        'required'          => true,
    6869                                ),
    6970                                'support_rep' => array(
    7071                                        'validate_callback' => array( $this, 'validate_user_slug_callback' ),
    71                                         'required' => true,
    72                                 )
    73                         )
     72                                        'required'          => true,
     73                                ),
     74                        ),
    7475                ) );
    7576        }
    … …  
    8384                $support_reps = array();
    8485                foreach ( (array) Tools::get_plugin_support_reps( $plugin_slug ) as $user_nicename ) {
    85                         $user = get_user_by( 'slug', $user_nicename );
     86                        $user           = get_user_by( 'slug', $user_nicename );
    8687                        $support_reps[] = $this->user_support_rep_details( $user );
    8788                }
    … …  
    158159                        'profile'  => esc_url( 'https://profiles.wordpress.org/' . $user->user_nicename ),
    159160                        'avatar'   => get_avatar_url( $user->ID, 32 ),
    160                         'name'     => Template::encode( $user->display_name )
     161                        'name'     => Template::encode( $user->display_name ),
    161162                );
    162163
Note: See TracChangeset for help on using the changeset viewer.