Skip to:
Content

bbPress.org

Changeset 7376


Ignore:
Timestamp:
11/20/2025 07:23:50 PM (3 weeks ago)
Author:
johnjamesjacoby
Message:

Tools - Code Improvement: stop ignoring more PHPCS sniffs.

  • Universal.WhiteSpace.CommaSpacing.TooMuchSpaceAfter
  • WordPress.Arrays.ArrayIndentation.ItemNotAligned
  • WordPress.Arrays.ArrayIndentation.MultiLineArrayItemNotAligned
  • WordPress.Arrays.ArrayKeySpacingRestrictions.NoSpacesAroundArrayKeys
  • WordPress.Arrays.ArrayKeySpacingRestrictions.SpacesAroundArrayKeys
  • WordPress.Arrays.MultipleStatementAlignment.MultilineItemSpaceBeforeDoubleArrow
  • WordPress.Arrays.MultipleStatementAlignment.SpaceBeforeDoubleArrow

This commit includes code formatting changes to pass the above PHPCS checks.

See #3658.

Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpcs.xml.dist

    r7375 r7376  
    472472    </rule>
    473473
    474     <rule ref="Universal.WhiteSpace.CommaSpacing.TooMuchSpaceAfter">
    475         <exclude-pattern>/src/*</exclude-pattern>
    476     </rule>
    477 
    478     <rule ref="WordPress.Arrays.ArrayIndentation.ItemNotAligned">
    479         <exclude-pattern>/src/*</exclude-pattern>
    480     </rule>
    481 
    482     <rule ref="WordPress.Arrays.ArrayIndentation.MultiLineArrayItemNotAligned">
    483         <exclude-pattern>/src/*</exclude-pattern>
    484     </rule>
    485 
    486     <rule ref="WordPress.Arrays.ArrayKeySpacingRestrictions.NoSpacesAroundArrayKeys">
    487         <exclude-pattern>/src/*</exclude-pattern>
    488     </rule>
    489 
    490     <rule ref="WordPress.Arrays.ArrayKeySpacingRestrictions.SpacesAroundArrayKeys">
    491         <exclude-pattern>/src/*</exclude-pattern>
    492     </rule>
    493 
    494474    <rule ref="WordPress.Arrays.ArrayKeySpacingRestrictions.TooMuchSpaceAfterKey">
    495475        <exclude-pattern>/src/*</exclude-pattern>
     
    500480    </rule>
    501481
    502     <rule ref="WordPress.Arrays.MultipleStatementAlignment.MultilineItemSpaceBeforeDoubleArrow">
    503         <exclude-pattern>/src/*</exclude-pattern>
    504     </rule>
    505 
    506     <rule ref="WordPress.Arrays.MultipleStatementAlignment.SpaceBeforeDoubleArrow">
    507         <exclude-pattern>/src/*</exclude-pattern>
    508     </rule>
    509 
    510482    <rule ref="WordPress.DateTime.CurrentTimeTimestamp.Requested">
    511483        <exclude-pattern>/src/*</exclude-pattern>
     
    517489
    518490    <rule ref="WordPress.Files.FileName.InvalidClassFileName">
    519     <exclude-pattern>/src/*</exclude-pattern>
     491        <exclude-pattern>/src/*</exclude-pattern>
    520492    </rule>
    521493
     
    524496    </rule>
    525497
    526     <rule ref="WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound">
    527         <exclude-pattern>/src/*</exclude-pattern>
    528     </rule>
    529 
    530498    <rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound">
    531499        <exclude-pattern>/src/*</exclude-pattern>
     
    533501
    534502    <rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedConstantFound">
    535     <exclude-pattern>/src/*</exclude-pattern>
     503        <exclude-pattern>/src/*</exclude-pattern>
    536504    </rule>
    537505
  • trunk/src/includes/admin/actions.php

    r7102 r7376  
    177177
    178178    // Forum topic count
    179     if ( isset( $columns[ 'bbp_forum_topic_count' ] ) ) {
    180         $columns[ 'bbp_forum_topic_count' ] = '<span class="vers bbp_topics_column"  title="' . esc_attr__( 'Topics', 'bbpress' ) . '"><span class="screen-reader-text">' . esc_html__( 'Topics', 'bbpress' ) . '</span></span>';
     179    if ( isset( $columns['bbp_forum_topic_count'] ) ) {
     180        $columns['bbp_forum_topic_count'] = '<span class="vers bbp_topics_column"  title="' . esc_attr__( 'Topics', 'bbpress' ) . '"><span class="screen-reader-text">' . esc_html__( 'Topics', 'bbpress' ) . '</span></span>';
    181181    }
    182182
    183183    // Forum reply count
    184     if ( isset( $columns[ 'bbp_forum_reply_count' ] ) ) {
    185         $columns[ 'bbp_forum_reply_count' ] = '<span class="vers bbp_replies_column"  title="' . esc_attr__( 'Replies', 'bbpress' ) . '"><span class="screen-reader-text">' . esc_html__( 'Replies', 'bbpress' ) . '</span></span>';
     184    if ( isset( $columns['bbp_forum_reply_count'] ) ) {
     185        $columns['bbp_forum_reply_count'] = '<span class="vers bbp_replies_column"  title="' . esc_attr__( 'Replies', 'bbpress' ) . '"><span class="screen-reader-text">' . esc_html__( 'Replies', 'bbpress' ) . '</span></span>';
    186186    }
    187187
     
    189189
    190190    // Topic forum
    191     if ( isset( $columns[ 'bbp_topic_forum' ] ) ) {
    192         $columns[ 'bbp_topic_forum' ] = '<span class="vers bbp_forums_column"  title="' . esc_attr__( 'Forum', 'bbpress' ) . '"><span class="screen-reader-text">' . esc_html__( 'Forum', 'bbpress' ) . '</span></span>';
     191    if ( isset( $columns['bbp_topic_forum'] ) ) {
     192        $columns['bbp_topic_forum'] = '<span class="vers bbp_forums_column"  title="' . esc_attr__( 'Forum', 'bbpress' ) . '"><span class="screen-reader-text">' . esc_html__( 'Forum', 'bbpress' ) . '</span></span>';
    193193    }
    194194
    195195    // Topic reply count
    196     if ( isset( $columns[ 'bbp_topic_reply_count' ] ) ) {
    197         $columns[ 'bbp_topic_reply_count' ] = '<span class="vers bbp_replies_column"  title="' . esc_attr__( 'Replies', 'bbpress' ) . '"><span class="screen-reader-text">' . esc_html__( 'Replies', 'bbpress' ) . '</span></span>';
     196    if ( isset( $columns['bbp_topic_reply_count'] ) ) {
     197        $columns['bbp_topic_reply_count'] = '<span class="vers bbp_replies_column"  title="' . esc_attr__( 'Replies', 'bbpress' ) . '"><span class="screen-reader-text">' . esc_html__( 'Replies', 'bbpress' ) . '</span></span>';
    198198    }
    199199
     
    201201
    202202    // Reply forum
    203     if ( isset( $columns[ 'bbp_reply_forum' ] ) ) {
    204         $columns[ 'bbp_reply_forum' ] = '<span class="vers bbp_forums_column"  title="' . esc_attr__( 'Forum', 'bbpress' ) . '"><span class="screen-reader-text">' . esc_html__( 'Forum', 'bbpress' ) . '</span></span>';
     203    if ( isset( $columns['bbp_reply_forum'] ) ) {
     204        $columns['bbp_reply_forum'] = '<span class="vers bbp_forums_column"  title="' . esc_attr__( 'Forum', 'bbpress' ) . '"><span class="screen-reader-text">' . esc_html__( 'Forum', 'bbpress' ) . '</span></span>';
    205205    }
    206206
    207207    // Reply topic
    208     if ( isset( $columns[ 'bbp_reply_topic' ] ) ) {
    209         $columns[ 'bbp_reply_topic' ] = '<span class="vers bbp_topics_column"  title="' . esc_attr__( 'Topic', 'bbpress' ) . '"><span class="screen-reader-text">' . esc_html__( 'Topic', 'bbpress' ) . '</span></span>';
     208    if ( isset( $columns['bbp_reply_topic'] ) ) {
     209        $columns['bbp_reply_topic'] = '<span class="vers bbp_topics_column"  title="' . esc_attr__( 'Topic', 'bbpress' ) . '"><span class="screen-reader-text">' . esc_html__( 'Topic', 'bbpress' ) . '</span></span>';
    210210    }
    211211
  • trunk/src/includes/admin/classes/class-bbp-admin.php

    r7374 r7376  
    447447
    448448            if ( false !== $found ) {
    449                 $menu[ $menu_index ][ 0 ] = bbp_maybe_append_pending_upgrade_count( $menu[ $menu_index ][ 0 ] );
     449                $menu[ $menu_index ][0] = bbp_maybe_append_pending_upgrade_count( $menu[ $menu_index ][0] );
    450450                continue;
    451451            }
     
    15091509
    15101510                            // Switch to the new site
    1511                             bbp_switch_to_site( $details[ 'blog_id' ] );
     1511                            bbp_switch_to_site( $details['blog_id'] );
    15121512
    15131513                            $basename = bbpress()->basename;
     
    15221522
    15231523                            // Do some actions to allow plugins to do things too
    1524                             do_action( 'after_bbpress_upgrade', $response             );
    1525                             do_action( 'bbp_upgrade_site',      $details[ 'blog_id' ] );
     1524                            do_action( 'after_bbpress_upgrade', $response           );
     1525                            do_action( 'bbp_upgrade_site',      $details['blog_id'] );
    15261526
    15271527                        endforeach; ?>
  • trunk/src/includes/admin/classes/class-bbp-converter.php

    r7360 r7376  
    320320
    321321            // Platform
    322             '_bbp_converter_platform' => ! empty( $_POST['_bbp_converter_platform' ] )
    323                 ? sanitize_text_field( $_POST['_bbp_converter_platform' ] )
     322            '_bbp_converter_platform' => ! empty( $_POST['_bbp_converter_platform'] )
     323                ? sanitize_text_field( $_POST['_bbp_converter_platform'] )
    324324                : '',
    325325
  • trunk/src/includes/admin/converters/Invision.php

    r7374 r7376  
    547547        $length = strlen( $input );
    548548        for ( $i = 0; $i < $length; $i++ ) {
    549             $j = ord( $input[$i] );
     549            $j = ord( $input[ $i ] );
    550550            if ( ( $j >= 65 && $j <= 90 )
    551551                || ( $j >= 97 && $j <= 122 )
    552552                || ( $j >= 48 && $j <= 57 ) ) {
    553                 $output .= $input[$i];
     553                $output .= $input[ $i ];
    554554            } else {
    555                 $output .= '&#' . ord( $input[$i] ) . ';';
     555                $output .= '&#' . ord( $input[ $i ] ) . ';';
    556556            }
    557557        }
  • trunk/src/includes/admin/converters/phpBB.php

    r7360 r7376  
    814814            }
    815815
    816             $output .= $itoa64[( $value >> 6 ) & 0x3f];
     816            $output .= $itoa64[ ( $value >> 6 ) & 0x3f ];
    817817
    818818            if ( $i++ >= $count ) {
     
    824824            }
    825825
    826             $output .= $itoa64[( $value >> 12 ) & 0x3f];
     826            $output .= $itoa64[ ( $value >> 12 ) & 0x3f ];
    827827
    828828            if ( $i++ >= $count ) {
     
    830830            }
    831831
    832             $output .= $itoa64[( $value >> 18 ) & 0x3f];
     832            $output .= $itoa64[ ( $value >> 18 ) & 0x3f ];
    833833        } while ( $i < $count );
    834834
  • trunk/src/includes/admin/metaboxes.php

    r7374 r7376  
    481481                'exclude'            => '',
    482482
    483             // Output-related
    484             'select_id'          => 'parent_id',
    485             'options_only'       => false,
    486             'show_none'          => esc_html__( '&mdash; No forum &mdash;', 'bbpress' ),
    487             'disable_categories' => current_user_can( 'edit_forums' ),
    488             'disabled'           => ''
     483                // Output-related
     484                'select_id'          => 'parent_id',
     485                'options_only'       => false,
     486                'show_none'          => esc_html__( '&mdash; No forum &mdash;', 'bbpress' ),
     487                'disable_categories' => current_user_can( 'edit_forums' ),
     488                'disabled'           => ''
    489489            )
    490490        );
  • trunk/src/includes/common/formatting.php

    r7373 r7376  
    2929        // Links
    3030        'a' => array(
    31             'href'     => true,
    32             'title'    => true,
    33             'rel'      => true,
    34             'target'   => true
     31            'href'   => true,
     32            'title'  => true,
     33            'rel'    => true,
     34            'target' => true
    3535        ),
    3636
    3737        // Quotes
    38         'blockquote'   => array(
    39             'cite'     => true
     38        'blockquote' => array(
     39            'cite' => true
    4040        ),
    4141
    4242        // Code
    43         'code'         => array(),
    44         'pre'          => array(
    45             'class'    => true
     43        'code' => array(),
     44        'pre'  => array(
     45            'class' => true
    4646        ),
    4747
    4848        // Formatting
    49         'em'           => array(),
    50         'strong'       => array(),
    51         'del'          => array(
     49        'em'     => array(),
     50        'strong' => array(),
     51        'del'    => array(
    5252            'datetime' => true,
    5353            'cite'     => true
     
    5959
    6060        // Lists
    61         'ul'           => array(),
    62         'ol'           => array(
    63             'start'    => true,
     61        'ul' => array(),
     62        'ol' => array(
     63            'start' => true,
    6464        ),
    65         'li'           => array(),
     65        'li' => array(),
    6666
    6767        // Images
    68         'img'          => array(
    69             'src'      => true,
    70             'border'   => true,
    71             'alt'      => true,
    72             'height'   => true,
    73             'width'    => true,
     68        'img' => array(
     69            'src'    => true,
     70            'border' => true,
     71            'alt'    => true,
     72            'height' => true,
     73            'width'  => true,
    7474        )
    7575    ) );
     
    661661        $chunks = array(
    662662            /* translators: %s: Number of years */
    663             array( YEAR_IN_SECONDS,   _n_noop( '%s year',   '%s years',   'bbpress' ) ),
     663            array( YEAR_IN_SECONDS, _n_noop( '%s year', '%s years', 'bbpress' ) ),
     664
    664665            /* translators: %s: Number of months */
    665             array( MONTH_IN_SECONDS,  _n_noop( '%s month',  '%s months',  'bbpress' ) ),
     666            array( MONTH_IN_SECONDS, _n_noop( '%s month', '%s months', 'bbpress' ) ),
     667
    666668            /* translators: %s: Number of weeks */
    667             array( WEEK_IN_SECONDS,   _n_noop( '%s week',   '%s weeks',   'bbpress' ) ),
     669            array( WEEK_IN_SECONDS, _n_noop( '%s week', '%s weeks', 'bbpress' ) ),
     670
    668671            /* translators: %s: Number of days */
    669             array( DAY_IN_SECONDS,    _n_noop( '%s day',    '%s days',    'bbpress' ) ),
     672            array( DAY_IN_SECONDS, _n_noop( '%s day', '%s days', 'bbpress' ) ),
     673
    670674            /* translators: %s: Number of hours */
    671             array( HOUR_IN_SECONDS,   _n_noop( '%s hour',   '%s hours',   'bbpress' ) ),
     675            array( HOUR_IN_SECONDS, _n_noop( '%s hour', '%s hours', 'bbpress' ) ),
     676
    672677            /* translators: %s: Number of minutes */
    673678            array( MINUTE_IN_SECONDS, _n_noop( '%s minute', '%s minutes', 'bbpress' ) ),
     679
    674680            /* translators: %s: Number of seconds */
    675             array( 1,                 _n_noop( '%s second', '%s seconds', 'bbpress' ) ),
     681            array( 1, _n_noop( '%s second', '%s seconds', 'bbpress' ) ),
    676682        );
    677683
  • trunk/src/includes/common/functions.php

    r7374 r7376  
    16121612
    16131613        // Assemble $redirect_to and add it (encoded) to full $url
    1614         $appended  = add_query_arg( array( 'loggedout'   => 'true'  ), $validated );
     1614        $appended  = add_query_arg( array( 'loggedout' => 'true' ), $validated );
    16151615        $encoded   = urlencode( $appended );
    1616         $url       = add_query_arg( array( 'redirect_to' => $encoded ), $url       );
     1616        $url       = add_query_arg( array( 'redirect_to' => $encoded ), $url );
    16171617    }
    16181618
  • trunk/src/includes/core/actions.php

    r7231 r7376  
    150150
    151151// Widgets
     152// phpcs:disable Universal.WhiteSpace.CommaSpacing.TooMuchSpaceAfter
    152153add_action( 'bbp_widgets_init', array( 'BBP_Login_Widget',   'register_widget' ), 10 );
    153154add_action( 'bbp_widgets_init', array( 'BBP_Views_Widget',   'register_widget' ), 10 );
     
    157158add_action( 'bbp_widgets_init', array( 'BBP_Replies_Widget', 'register_widget' ), 10 );
    158159add_action( 'bbp_widgets_init', array( 'BBP_Stats_Widget',   'register_widget' ), 10 );
     160// phpcs:enable
    159161
    160162// Notices
  • trunk/src/includes/core/theme-compat.php

    r7363 r7376  
    10061006
    10071007        // Filters exist in this priority
    1008         if ( ! empty( $priority ) && isset( $bbp->filters->wp_filter[ $tag ][ $priority  ] ) ) {
     1008        if ( ! empty( $priority ) && isset( $bbp->filters->wp_filter[ $tag ][ $priority ] ) ) {
    10091009
    10101010            // Store filters in a backup
  • trunk/src/includes/core/update.php

    r7352 r7376  
    246246        ),
    247247        array(
    248             'forum_id'     => $forum_id
     248            'forum_id' => $forum_id
    249249        )
    250250    );
     
    259259        ),
    260260        array(
    261             'forum_id'     => $forum_id,
    262             'topic_id'     => $topic_id
     261            'forum_id' => $forum_id,
     262            'topic_id' => $topic_id
    263263        )
    264264    );
  • trunk/src/includes/topics/template.php

    r7374 r7376  
    390390        // Conditionally exclude private/hidden forum ID's
    391391        $exclude_forum_ids = bbp_exclude_forum_ids( 'array' );
     392        $post_parent_id    = $r['post_parent'];
    392393
    393394        // Maybe remove the current forum from excluded forum IDs
    394         if ( ! empty( $r['post_parent' ] ) ) {
    395             unset( $exclude_forum_ids[ $r['post_parent' ] ] );
     395        if ( ! empty( $post_parent_id ) ) {
     396            unset( $exclude_forum_ids[ $post_parent_id ] );
    396397        }
    397398
  • trunk/src/includes/users/template.php

    r7366 r7376  
    159159
    160160        if ( $this->user_count > 0 ) {
    161             $this->user = $this->results[ 0 ];
     161            $this->user = $this->results[0];
    162162        }
    163163    }
Note: See TracChangeset for help on using the changeset viewer.