Skip to:
Content

bbPress.org

Changeset 5908


Ignore:
Timestamp:
08/11/2015 08:17:53 PM (10 years ago)
Author:
johnjamesjacoby
Message:

Sniffer: Whitespace around variables in arrays.

Location:
trunk/src/includes
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/admin/converters/e107v1.php

    r5829 r5908  
    567567        $field = preg_replace( '/(\d+?)+\.[\S\s]+/', '$1', $field );
    568568
    569         if ( ! isset( $this->map_userid[$field] ) ) {
     569        if ( ! isset( $this->map_userid[ $field ] ) ) {
    570570            if ( ! empty( $this->sync_table ) ) {
    571571                $row = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_user_id" AND meta_value = "%s" LIMIT 1', $field ) );
     
    575575
    576576            if ( !is_null( $row ) ) {
    577                 $this->map_userid[$field] = $row->value_id;
     577                $this->map_userid[ $field ] = $row->value_id;
    578578            } else {
    579579                if ( ! empty( $_POST['_bbp_converter_convert_users'] ) && ( $_POST['_bbp_converter_convert_users'] == 1 ) ) {
    580                     $this->map_userid[$field] = 0;
     580                    $this->map_userid[ $field ] = 0;
    581581                } else {
    582                     $this->map_userid[$field] = $field;
     582                    $this->map_userid[ $field ] = $field;
    583583                }
    584584            }
    585585        }
    586         return $this->map_userid[$field];
     586        return $this->map_userid[ $field ];
    587587    }
    588588
  • trunk/src/includes/admin/converters/phpBB.php

    r5798 r5908  
    796796
    797797        do {
    798             $value = ord( $input[$i++] );
    799             $output .= $itoa64[$value & 0x3f];
     798            $value = ord( $input[ $i++ ] );
     799            $output .= $itoa64[ $value & 0x3f ];
    800800
    801801            if ($i < $count) {
    802                 $value |= ord( $input[$i] ) << 8;
     802                $value |= ord( $input[ $i ] ) << 8;
    803803            }
    804804
     
    810810
    811811            if ( $i < $count ) {
    812                 $value |= ord( $input[$i] ) << 16;
     812                $value |= ord( $input[ $i ] ) << 16;
    813813            }
    814814
  • trunk/src/includes/admin/forums.php

    r5868 r5908  
    803803
    804804        // Messages array
    805         $messages[$this->post_type] = array(
     805        $messages[ $this->post_type ] = array(
    806806            0 =>  '', // Left empty on purpose
    807807
  • trunk/src/includes/admin/replies.php

    r5850 r5908  
    920920
    921921        // Messages array
    922         $messages[$this->post_type] = array(
     922        $messages[ $this->post_type ] = array(
    923923            0 =>  '', // Left empty on purpose
    924924
  • trunk/src/includes/admin/settings.php

    r5884 r5908  
    442442
    443443    $fields = bbp_admin_get_settings_fields();
    444     $retval = isset( $fields[$section_id] ) ? $fields[$section_id] : false;
     444    $retval = isset( $fields[ $section_id ] )
     445        ? $fields[ $section_id ]
     446        : false;
    445447
    446448    return (array) apply_filters( 'bbp_admin_get_settings_fields_for_section', $retval, $section_id );
     
    16301632 */
    16311633function bbp_maybe_admin_setting_disabled( $option_key = '' ) {
    1632     disabled( isset( bbpress()->options[$option_key] ) );
     1634    disabled( isset( bbpress()->options[ $option_key ] ) );
    16331635}
    16341636
     
    17581760                    $page_base    = $page . '_base';
    17591761                    $page_title   = sprintf( __( '%s page', 'bbpress' ), $page_data->title );
    1760                     $core_slugs[$page_base] = array( 'name' => $page_title, 'default' => $page_data->slug, 'context' => 'BuddyPress' );
     1762                    $core_slugs[ $page_base ] = array(
     1763                        'name'    => $page_title,
     1764                        'default' => $page_data->slug,
     1765                        'context' => 'BuddyPress'
     1766                    );
    17611767                }
    17621768            }
  • trunk/src/includes/admin/tools.php

    r5899 r5908  
    18651865
    18661866        // Get sticky topic ID's, or use empty string
    1867         $stickers = empty( $forum_stickies[$forum_id] ) ? '' : array_values( $forum_stickies[ $forum_id ] );
     1867        $stickers = empty( $forum_stickies[ $forum_id ] ) ? '' : array_values( $forum_stickies[ $forum_id ] );
    18681868
    18691869        // Update the forum's sticky topics meta
  • trunk/src/includes/admin/topics.php

    r5886 r5908  
    10731073
    10741074        // Messages array
    1075         $messages[$this->post_type] = array(
     1075        $messages[ $this->post_type ] = array(
    10761076            0 =>  '', // Left empty on purpose
    10771077
  • trunk/src/includes/admin/users.php

    r5770 r5908  
    255255            if ( ! empty( $user_role ) ) {
    256256                $roles  = bbp_get_dynamic_roles();
    257                 $retval = translate_user_role( $roles[$user_role]['name'] );
     257                $retval = translate_user_role( $roles[ $user_role ]['name'] );
    258258            }
    259259        }
  • trunk/src/includes/common/classes.php

    r5829 r5908  
    374374        // If we're at the max depth and the current element still has children, loop over those
    375375        // and display them at this level to prevent them being orphaned to the end of the list.
    376         if ( ( $max_depth <= (int) $depth + 1 ) && isset( $children_elements[$id] ) ) {
    377             foreach ( $children_elements[$id] as $child ) {
     376        if ( ( $max_depth <= (int) $depth + 1 ) && isset( $children_elements[ $id ] ) ) {
     377            foreach ( $children_elements[ $id ] as $child ) {
    378378                $this->display_element( $child, $children_elements, $max_depth, $depth, $args, $output );
    379379            }
    380             unset( $children_elements[$id] );
     380            unset( $children_elements[ $id ] );
    381381        }
    382382    }
  • trunk/src/includes/common/formatting.php

    r5770 r5908  
    171171
    172172        // Which walker to use based on the tag and arguments
    173         if ( isset( $empty[$tag] ) ) {
     173        if ( isset( $empty[ $tag ] ) ) {
    174174            array_walk( $content, 'bbp_encode_empty_callback',  $preg );
    175175        } else {
  • trunk/src/includes/common/functions.php

    r5907 r5908  
    152152            // Step one: the first chunk
    153153            for ( $i = 0, $j = count( $chunks ); $i < $j; ++$i ) {
    154                 $seconds = $chunks[$i][0];
     154                $seconds = $chunks[ $i ][0];
    155155
    156156                // Finding the biggest chunk (if the chunk fits, break)
     
    162162
    163163            // If $i iterates all the way to $j, then the event happened 0 seconds ago
    164             if ( ! isset( $chunks[$i] ) ) {
     164            if ( ! isset( $chunks[ $i ] ) ) {
    165165                $output = $right_now_text;
    166166
     
    168168
    169169                // Set output var
    170                 $output = ( 1 == $count ) ? '1 '. $chunks[$i][1] : $count . ' ' . $chunks[$i][2];
     170                $output = ( 1 == $count ) ? '1 '. $chunks[ $i ][1] : $count . ' ' . $chunks[ $i ][2];
    171171
    172172                // Step two: the second chunk
    173173                if ( $i + 2 < $j ) {
    174                     $seconds2 = $chunks[$i + 1][0];
    175                     $name2    = $chunks[$i + 1][1];
     174                    $seconds2 = $chunks[ $i + 1 ][0];
     175                    $name2    = $chunks[ $i + 1 ][1];
    176176                    $count2   = floor( ( $since - ( $seconds * $count ) ) / $seconds2 );
    177177
    178178                    // Add to output var
    179179                    if ( 0 != $count2 ) {
    180                         $output .= ( 1 == $count2 ) ? _x( ',', 'Separator in time since', 'bbpress' ) . ' 1 '. $name2 : _x( ',', 'Separator in time since', 'bbpress' ) . ' ' . $count2 . ' ' . $chunks[$i + 1][2];
     180                        $output .= ( 1 == $count2 ) ? _x( ',', 'Separator in time since', 'bbpress' ) . ' 1 '. $name2 : _x( ',', 'Separator in time since', 'bbpress' ) . ' ' . $count2 . ' ' . $chunks[ $i + 1 ][2];
    181181                    }
    182182                }
     
    18821882                // Setup matched variables to select
    18831883                foreach ( $query_vars as $key => $value ) {
    1884                     if ( isset( $select_query_vars[$key] ) ) {
    1885                         $select_query_vars[$key] = $value;
     1884                    if ( isset( $select_query_vars[ $key ] ) ) {
     1885                        $select_query_vars[ $key ] = $value;
    18861886                    }
    18871887                }
  • trunk/src/includes/common/template.php

    r5868 r5908  
    13091309
    13101310        // Set request varaible
    1311         $pre_ret_val = $_REQUEST[$request];
     1311        $pre_ret_val = $_REQUEST[ $request ];
    13121312
    13131313        // Treat different kinds of fields in different ways
     
    18901890    foreach ( $plugins as $key => $value ) {
    18911891        if ( 'fullscreen' === $value ) {
    1892             unset( $plugins[$key] );
     1892            unset( $plugins[ $key ] );
    18931893            break;
    18941894        }
  • trunk/src/includes/core/capabilities.php

    r5827 r5908  
    349349function _bbp_reinit_dynamic_roles( $roles = array() ) {
    350350    foreach ( bbp_get_dynamic_roles() as $role_id => $details ) {
    351         $roles[$role_id] = $details;
     351        $roles[ $role_id ] = $details;
    352352    }
    353353    return $roles;
  • trunk/src/includes/core/functions.php

    r5829 r5908  
    200200    }
    201201
    202     $bbp->views[$view] = array(
     202    $bbp->views[ $view ] = array(
    203203        'title'  => $title,
    204204        'query'  => $query_args,
     
    206206    );
    207207
    208     return $bbp->views[$view];
     208    return $bbp->views[ $view ];
    209209}
    210210
     
    272272function bbp_get_view_query_args( $view ) {
    273273    $view   = bbp_get_view_id( $view );
    274     $retval = ! empty( $view ) ? bbpress()->views[$view]['query'] : false;
     274    $retval = ! empty( $view )
     275        ? bbpress()->views[ $view ]['query']
     276        : false;
    275277
    276278    return apply_filters( 'bbp_get_view_query_args', $retval, $view );
  • trunk/src/includes/core/template-functions.php

    r5829 r5908  
    322322    // Sort
    323323    if ( ! isset( $merged_filters[ $tag ] ) ) {
    324         ksort( $wp_filter[$tag] );
     324        ksort( $wp_filter[ $tag ] );
    325325        $merged_filters[ $tag ] = true;
    326326    }
     
    331331    // Loop through 'bbp_template_stack' filters, and call callback functions
    332332    do {
    333         foreach ( (array) current( $wp_filter[$tag] ) as $the_ ) {
     333        foreach ( (array) current( $wp_filter[ $tag ] ) as $the_ ) {
    334334            if ( ! is_null( $the_['function'] ) ) {
    335335                $args[1] = $stack;
     
    337337            }
    338338        }
    339     } while ( next( $wp_filter[$tag] ) !== false );
     339    } while ( next( $wp_filter[ $tag ] ) !== false );
    340340
    341341    // Remove 'bbp_template_stack' from the current filter array
  • trunk/src/includes/core/theme-compat.php

    r5829 r5908  
    6969     */
    7070    public function __set( $property, $value ) {
    71         return $this->_data[$property] = $value;
     71        return $this->_data[ $property ] = $value;
    7272    }
    7373
     
    8181     */
    8282    public function __get( $property ) {
    83         return array_key_exists( $property, $this->_data ) ? $this->_data[$property] : '';
     83        return array_key_exists( $property, $this->_data )
     84            ? $this->_data[ $property ]
     85            : '';
    8486    }
    8587}
     
    9799
    98100    // Make sure theme package is available, set to default if not
    99     if ( ! isset( $bbp->theme_compat->packages[$theme] ) || ! is_a( $bbp->theme_compat->packages[$theme], 'BBP_Theme_Compat' ) ) {
     101    if ( ! isset( $bbp->theme_compat->packages[ $theme ] ) || ! is_a( $bbp->theme_compat->packages[ $theme ], 'BBP_Theme_Compat' ) ) {
    100102        $theme = 'default';
    101103    }
     
    103105    // Try to set the active theme compat theme. If it's not in the registered
    104106    // packages array, it doesn't exist, so do nothing with it.
    105     if ( isset( $bbp->theme_compat->packages[$theme] ) ) {
    106         $bbp->theme_compat->theme = $bbp->theme_compat->packages[$theme];
     107    if ( isset( $bbp->theme_compat->packages[ $theme ] ) ) {
     108        $bbp->theme_compat->theme = $bbp->theme_compat->packages[ $theme ];
    107109    }
    108110}
     
    289291
    290292    // Only override if the flag is set and not previously registered
    291     if ( empty( $bbp->theme_compat->packages[$theme->id] ) || ( true === $override ) ) {
    292         $bbp->theme_compat->packages[$theme->id] = $theme;
     293    if ( empty( $bbp->theme_compat->packages[ $theme->id ] ) || ( true === $override ) ) {
     294        $bbp->theme_compat->packages[ $theme->id ] = $theme;
    293295    }
    294296}
     
    874876
    875877    // Filters exist
    876     if ( isset( $wp_filter[$tag] ) ) {
     878    if ( isset( $wp_filter[ $tag ] ) ) {
    877879
    878880        // Filters exist in this priority
    879         if ( ! empty( $priority ) && isset( $wp_filter[$tag][$priority] ) ) {
     881        if ( ! empty( $priority ) && isset( $wp_filter[ $tag ][ $priority ] ) ) {
    880882
    881883            // Store filters in a backup
    882             $bbp->filters->wp_filter[$tag][$priority] = $wp_filter[$tag][$priority];
     884            $bbp->filters->wp_filter[ $tag ][ $priority ] = $wp_filter[ $tag ][ $priority ];
    883885
    884886            // Unset the filters
    885             unset( $wp_filter[$tag][$priority] );
     887            unset( $wp_filter[ $tag ][ $priority ] );
    886888
    887889        // Priority is empty
     
    889891
    890892            // Store filters in a backup
    891             $bbp->filters->wp_filter[$tag] = $wp_filter[$tag];
     893            $bbp->filters->wp_filter[ $tag ] = $wp_filter[ $tag ];
    892894
    893895            // Unset the filters
    894             unset( $wp_filter[$tag] );
     896            unset( $wp_filter[ $tag ] );
    895897        }
    896898    }
    897899
    898900    // Check merged filters
    899     if ( isset( $merged_filters[$tag] ) ) {
     901    if ( isset( $merged_filters[ $tag ] ) ) {
    900902
    901903        // Store filters in a backup
    902         $bbp->filters->merged_filters[$tag] = $merged_filters[$tag];
     904        $bbp->filters->merged_filters[ $tag ] = $merged_filters[ $tag ];
    903905
    904906        // Unset the filters
    905         unset( $merged_filters[$tag] );
     907        unset( $merged_filters[ $tag ] );
    906908    }
    907909
     
    926928
    927929    // Filters exist
    928     if ( isset( $bbp->filters->wp_filter[$tag] ) ) {
     930    if ( isset( $bbp->filters->wp_filter[ $tag ] ) ) {
    929931
    930932        // Filters exist in this priority
    931         if ( ! empty( $priority ) && isset( $bbp->filters->wp_filter[$tag][$priority] ) ) {
     933        if ( ! empty( $priority ) && isset( $bbp->filters->wp_filter[ $tag ][ $priority  ] ) ) {
    932934
    933935            // Store filters in a backup
    934             $wp_filter[$tag][$priority] = $bbp->filters->wp_filter[$tag][$priority];
     936            $wp_filter[ $tag ][ $priority ] = $bbp->filters->wp_filter[ $tag ][ $priority ];
    935937
    936938            // Unset the filters
    937             unset( $bbp->filters->wp_filter[$tag][$priority] );
     939            unset( $bbp->filters->wp_filter[ $tag ][ $priority ] );
    938940
    939941        // Priority is empty
     
    941943
    942944            // Store filters in a backup
    943             $wp_filter[$tag] = $bbp->filters->wp_filter[$tag];
     945            $wp_filter[ $tag ] = $bbp->filters->wp_filter[ $tag ];
    944946
    945947            // Unset the filters
    946             unset( $bbp->filters->wp_filter[$tag] );
     948            unset( $bbp->filters->wp_filter[ $tag ] );
    947949        }
    948950    }
    949951
    950952    // Check merged filters
    951     if ( isset( $bbp->filters->merged_filters[$tag] ) ) {
     953    if ( isset( $bbp->filters->merged_filters[ $tag ] ) ) {
    952954
    953955        // Store filters in a backup
    954         $merged_filters[$tag] = $bbp->filters->merged_filters[$tag];
     956        $merged_filters[ $tag ] = $bbp->filters->merged_filters[ $tag ];
    955957
    956958        // Unset the filters
    957         unset( $bbp->filters->merged_filters[$tag] );
     959        unset( $bbp->filters->merged_filters[ $tag ] );
    958960    }
    959961
  • trunk/src/includes/extend/akismet.php

    r5842 r5908  
    399399            // Key should not be ignored
    400400            if ( ! in_array( $key, $ignore ) && is_string( $value ) ) {
    401                 $post_data[$key] = $value;
     401                $post_data[ $key ] = $value;
    402402
    403403            // Key should be ignored
    404404            } else {
    405                 $post_data[$key] = '';
     405                $post_data[ $key ] = '';
    406406            }
    407407        }
  • trunk/src/includes/extend/buddypress/groups.php

    r5906 r5908  
    371371                if ( empty( $forum ) ) {
    372372                    $this->remove_forum( array( 'forum_id' => $forum_id ) );
    373                     unset( $forum_ids[$forum_id] );
     373                    unset( $forum_ids[ $forum_id ] );
    374374                }
    375375            }
    376376
    377377            // No support for multiple forums yet
    378             $forum_id = (int) ( is_array( $forum_ids ) ? $forum_ids[0] : $forum_ids );
     378            $forum_id = (int) ( is_array( $forum_ids )
     379                ? $forum_ids[0]
     380                : $forum_ids );
    379381        }
    380382
  • trunk/src/includes/forums/functions.php

    r5858 r5908  
    19841984            $key = array_search( bbp_get_private_status_id(), $post_stati );
    19851985            if ( ! empty( $key ) ) {
    1986                 unset( $post_stati[$key] );
     1986                unset( $post_stati[ $key ] );
    19871987            }
    19881988
     
    19981998            $key = array_search( bbp_get_hidden_status_id(), $post_stati );
    19991999            if ( ! empty( $key ) ) {
    2000                 unset( $post_stati[$key] );
     2000                unset( $post_stati[ $key ] );
    20012001            }
    20022002
  • trunk/src/includes/replies/template.php

    r5894 r5908  
    799799        foreach ( (array) $revisions as $revision ) {
    800800
    801             if ( empty( $revision_log[$revision->ID] ) ) {
     801            if ( empty( $revision_log[ $revision->ID ] ) ) {
    802802                $author_id = $revision->post_author;
    803803                $reason    = '';
    804804            } else {
    805                 $author_id = $revision_log[$revision->ID]['author'];
    806                 $reason    = $revision_log[$revision->ID]['reason'];
     805                $author_id = $revision_log[ $revision->ID ]['author'];
     806                $reason    = $revision_log[ $revision->ID ]['reason'];
    807807            }
    808808
  • trunk/src/includes/topics/functions.php

    r5893 r5908  
    32353235    foreach ( (array) $stickies as $key => $id ) {
    32363236        if ( ! bbp_is_topic( $id ) ) {
    3237             unset( $stickies[$key] );
     3237            unset( $stickies[ $key ] );
    32383238        }
    32393239    }
  • trunk/src/includes/users/capabilities.php

    r5834 r5908  
    365365
    366366    // Use a mapped role
    367     if ( isset( $role_map[$user_role] ) ) {
    368         $new_role = $role_map[$user_role];
     367    if ( isset( $role_map[ $user_role ] ) ) {
     368        $new_role = $role_map[ $user_role ];
    369369
    370370    // Use the default role
     
    385385    // Don't add the user, but still give them the correct caps dynamically
    386386    } else {
    387         $bbp->current_user->caps[$new_role] = true;
     387        $bbp->current_user->caps[ $new_role ] = true;
    388388        $bbp->current_user->get_role_caps();
    389389    }
  • trunk/src/includes/users/functions.php

    r5888 r5908  
    105105
    106106        if ( ! empty( $key ) && in_array( $key, array_keys( $cookie_names ) ) ) {
    107             return $bbp_current_poster[$cookie_names[$key]];
     107            return $bbp_current_poster[ $cookie_names[ $key ] ];
    108108        }
    109109
  • trunk/src/includes/users/options.php

    r5770 r5908  
    116116
    117117    // Check the options global for preset value
    118     if ( isset( $user->ID ) && isset( $bbp->user_options[$user->ID] ) && ! empty( $bbp->user_options[$user->ID][$option] ) ) {
    119         $value = $bbp->user_options[$user->ID][$option];
     118    if ( isset( $user->ID ) && isset( $bbp->user_options[ $user->ID ] ) && ! empty( $bbp->user_options[ $user->ID ][ $option ] ) ) {
     119        $value = $bbp->user_options[ $user->ID ][ $option ];
    120120    }
    121121
Note: See TracChangeset for help on using the changeset viewer.