Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/01/2024 04:26:18 PM (2 years ago)
Author:
espellcaste
Message:

WPCS: The modified code addresses all Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword and Squiz.Functions.MultiLineFunctionDeclaration.SpaceAfterFunction issues specific to the foreach and function examples.

See #7228

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/classes/class-bp-component.php

    r13741 r13878  
    652652                        // Sub nav items are not required.
    653653                        if ( ! empty( $sub_nav ) ) {
    654                                 foreach( (array) $sub_nav as $nav ) {
     654                                foreach ( (array) $sub_nav as $nav ) {
    655655                                        if ( ! isset( $nav['slug'], $nav['parent_slug'] ) ) {
    656656                                                continue;
    … …  
    732732                                // Sub nav items are not required.
    733733                                if ( $this->sub_nav ) {
    734                                         foreach( (array) $this->sub_nav as $nav ) {
     734                                        foreach ( (array) $this->sub_nav as $nav ) {
    735735                                                if ( isset( $nav['user_has_access_callback'] ) && is_callable( $nav['user_has_access_callback'] ) ) {
    736736                                                        $nav['user_has_access'] = call_user_func( $nav['user_has_access_callback'] );
    … …  
    773773                                $this->sub_nav = $sub_nav;
    774774
    775                                 foreach( (array) $sub_nav as $nav ) {
     775                                foreach ( (array) $sub_nav as $nav ) {
    776776                                        bp_core_new_subnav_item( $nav, 'members' );
    777777                                }
    … …  
    828828                        $pos = 0;
    829829                        $not_set_pos = 1;
    830                         foreach( $wp_admin_nav as $key => $nav ) {
     830                        foreach ( $wp_admin_nav as $key => $nav ) {
    831831                                if ( ! isset( $nav['position'] ) ) {
    832832                                        $wp_admin_nav[$key]['position'] = $pos + $not_set_pos;
    … …  
    852852
    853853                        // Add each admin menu.
    854                         foreach( $this->admin_menu as $admin_menu ) {
     854                        foreach ( $this->admin_menu as $admin_menu ) {
    855855                                $wp_admin_bar->add_node( $admin_menu );
    856856                        }
    … …  
    972972                 */
    973973                if ( !empty( $tables ) && is_array( $tables ) ) {
    974                         foreach( $tables as $meta_prefix => $table_name ) {
     974                        foreach ( $tables as $meta_prefix => $table_name ) {
    975975                                $wpdb->{$meta_prefix . 'meta'} = $table_name;
    976976                        }
    … …  
    14031403                        $controllers = (array) apply_filters( 'bp_' . $this->id . '_rest_api_controllers', $controllers );
    14041404
    1405                         foreach( $controllers as $controller ) {
     1405                        foreach ( $controllers as $controller ) {
    14061406                                if ( ! in_array( $controller, $_controllers, true ) ) {
    14071407                                        continue;
Note: See TracChangeset for help on using the changeset viewer.