Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/24/2021 04:16:17 AM (5 years ago)
Author:
espellcaste
Message:

Making PHPDoc Improvements to the BP Friends (component) files.

Also, adding several minor PHP changes.

See #8553

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-friends/actions/remove-friend.php

    r11931 r13092  
    11<?php
    22/**
    3  * Friends: Remove action
     3 * Friends: Remove action.
    44 *
    55 * @package BuddyPress
    … …  
    1414 */
    1515function friends_action_remove_friend() {
    16         if ( !bp_is_friends_component() || !bp_is_current_action( 'remove-friend' ) )
     16        if ( ! bp_is_friends_component() || ! bp_is_current_action( 'remove-friend' ) ) {
    1717                return false;
     18        }
    1819
    19         if ( !$potential_friend_id = (int)bp_action_variable( 0 ) )
     20        $potential_friend_id = (int) bp_action_variable( 0 );
     21        if ( ! $potential_friend_id ) {
    2022                return false;
     23        }
    2124
    22         if ( $potential_friend_id == bp_loggedin_user_id() )
     25        if ( bp_loggedin_user_id() === $potential_friend_id ) {
    2326                return false;
     27        }
    2428
    2529        $friendship_status = BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), $potential_friend_id );
    2630
    27         if ( 'is_friend' == $friendship_status ) {
     31        if ( 'is_friend' === $friendship_status ) {
    2832
    29                 if ( !check_admin_referer( 'friends_remove_friend' ) )
     33                if ( ! check_admin_referer( 'friends_remove_friend' ) ) {
    3034                        return false;
     35                }
    3136
    32                 if ( !friends_remove_friend( bp_loggedin_user_id(), $potential_friend_id ) ) {
     37                if ( ! friends_remove_friend( bp_loggedin_user_id(), $potential_friend_id ) ) {
    3338                        bp_core_add_message( __( 'Friendship could not be canceled.', 'buddypress' ), 'error' );
    3439                } else {
    3540                        bp_core_add_message( __( 'Friendship canceled', 'buddypress' ) );
    3641                }
    37 
    38         } elseif ( 'not_friends' == $friendship_status ) {
     42        } elseif ( 'not_friends' === $friendship_status ) {
    3943                bp_core_add_message( __( 'You are not yet friends with this user', 'buddypress' ), 'error' );
    4044        } else {
Note: See TracChangeset for help on using the changeset viewer.