Skip to content

Commit 4479103

Browse files
committed
Reorder statement to make phpcs happy
1 parent 5952ed3 commit 4479103

File tree

6 files changed

+10
-16
lines changed

6 files changed

+10
-16
lines changed

inc/admin/class-listtable.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ public function prepare_items() {
1717
$args = [
1818
'post_type' => Client::POST_TYPE,
1919
'post_status' => 'any',
20-
// 'meta_query' => [
21-
// [
22-
// 'key' => 'type',
23-
// 'value' => 'oauth2',
24-
// ],
25-
// ],
2620
'paged' => $paged,
2721
];
2822

@@ -32,7 +26,7 @@ public function prepare_items() {
3226
$pagination_args = [
3327
'total_items' => $query->found_posts,
3428
'total_pages' => $query->max_num_pages,
35-
'per_page' => $query->get( 'posts_per_page' )
29+
'per_page' => $query->get( 'posts_per_page' ),
3630
];
3731
$this->set_pagination_args( $pagination_args );
3832
}
@@ -62,10 +56,10 @@ public function get_columns() {
6256
public function column_cb( $item ) {
6357
?>
6458
<label class="screen-reader-text"
65-
for="cb-select-<?php echo esc_attr( $item->ID ) ?>"><?php esc_html_e( 'Select consumer', 'oauth2' ); ?></label>
59+
for="cb-select-<?php echo esc_attr( $item->ID ) ?>"><?php esc_html_e( 'Select consumer', 'oauth2' ); ?></label>
6660

6761
<input id="cb-select-<?php echo esc_attr( $item->ID ) ?>" type="checkbox"
68-
name="consumers[]" value="<?php echo esc_attr( $item->ID ) ?>"/>
62+
name="consumers[]" value="<?php echo esc_attr( $item->ID ) ?>"/>
6963

7064
<?php
7165
}

inc/admin/namespace.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function render() {
110110
<?php
111111
esc_html_e( 'Registered Applications', 'oauth2' );
112112

113-
if ( current_user_can( 'create_users' ) ): ?>
113+
if ( current_user_can( 'create_users' ) ) : ?>
114114
<a href="<?php echo esc_url( get_url( 'action=add' ) ) ?>"
115115
class="add-new-h2"><?php echo esc_html_x( 'Add New', 'application', 'oauth2' ); ?></a>
116116
<?php

inc/admin/profile/namespace.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function render_profile_section( WP_User $user ) {
2828
$tokens = Access_Token::get_for_user( $user );
2929
?>
3030
<h2><?php _e( 'Authorized Applications', 'oauth2' ) ?></h2>
31-
<?php if ( ! empty( $tokens ) ): ?>
31+
<?php if ( ! empty( $tokens ) ) : ?>
3232
<table class="widefat">
3333
<thead>
3434
<tr>
@@ -44,7 +44,7 @@ function render_profile_section( WP_User $user ) {
4444
?>
4545
</tbody>
4646
</table>
47-
<?php else: ?>
47+
<?php else : ?>
4848
<p class="description"><?php esc_html_e( 'No applications authorized.', 'oauth2' ) ?></p>
4949
<?php endif ?>
5050
<?php

inc/namespace.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function get_grant_types() {
7272
* @return array Grant types with additional types registered.
7373
*/
7474
function register_grant_types( $types ) {
75-
$types['authorization_code'] = new Types\AuthorizationCode();
75+
$types['authorization_code'] = new Types\Authorization_Code();
7676
$types['implicit'] = new Types\Implicit();
7777

7878
return $types;

inc/types/class-authorization-code.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use WP_Error;
66
use WP\OAuth2\Client;
77

8-
class AuthorizationCode extends Base {
8+
class Authorization_Code extends Base {
99
/**
1010
* Get response_type code for authorisation page.
1111
*

inc/types/class-base.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ public function handle_authorisation() {
6969
}
7070

7171
// Check nonce.
72-
$nonce = wp_unslash( $_POST['_wpnonce'] );
73-
if ( ! wp_verify_nonce( $nonce, $this->get_nonce_action( $client ) ) ) {
72+
$nonce_action = $this->get_nonce_action( $client );
73+
if ( ! wp_verify_nonce( wp_unslash( $_POST['_wpnonce'] ), $none_action ) ) {
7474
return new WP_Error(
7575
'oauth2.types.authorization_code.handle_authorisation.invalid_nonce',
7676
__( 'Invalid nonce.', 'oauth2' )

0 commit comments

Comments
 (0)