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-xprofile/classes/class-bp-xprofile-group.php

    r13797 r13878  
    325325                $field_ids = self::get_group_field_ids( $group_ids, $r );
    326326
    327                 foreach( $groups as $group ) {
     327                foreach ( $groups as $group ) {
    328328                        $group->fields = array();
    329329                }
    … …  
    381381
    382382                                // Loop through the results and find the fields that have data.
    383                                 foreach( (array) $field_data as $data ) {
     383                                foreach ( (array) $field_data as $data ) {
    384384
    385385                                        // Empty fields may contain a serialized empty array.
    … …  
    395395
    396396                                // The remaining members of $field_ids are empty. Remove them.
    397                                 foreach( $fields as $field_key => $field ) {
     397                                foreach ( $fields as $field_key => $field ) {
    398398                                        if ( in_array( $field->id, $field_ids ) ) {
    399399                                                unset( $fields[ $field_key ] );
    … …  
    409409
    410410                                // Loop through fields.
    411                                 foreach( (array) $fields as $field_key => $field ) {
     411                                foreach ( (array) $fields as $field_key => $field ) {
    412412
    413413                                        // Loop through the data in each field.
    414                                         foreach( (array) $field_data as $data ) {
     414                                        foreach ( (array) $field_data as $data ) {
    415415
    416416                                                // Assign correct data value to the field.
    … …  
    439439
    440440                // Merge the field array back in with the group array.
    441                 foreach( (array) $groups as $group ) {
     441                foreach ( (array) $groups as $group ) {
    442442                        // Indexes may have been shifted after previous deletions, so we get a
    443443                        // fresh one each time through the loop.
    444444                        $index = array_search( $group, $groups );
    445445
    446                         foreach( (array) $fields as $field ) {
     446                        foreach ( (array) $fields as $field ) {
    447447                                if ( $group->id === $field->group_id ) {
    448448                                        $groups[ $index ]->fields[] = $field;
    … …  
    757757                $visibility_levels = bp_get_user_meta( $user_id, 'bp_xprofile_visibility_levels', true );
    758758
    759                 foreach( (array) $fields as $key => $field ) {
     759                foreach ( (array) $fields as $key => $field ) {
    760760
    761761                        // Does the admin allow this field to be customized?
Note: See TracChangeset for help on using the changeset viewer.