Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/29/2020 09:43:16 PM (6 years ago)
Author:
imath
Message:

Core: fix PHP code standards & typos in inline comments

Props passoniate

Fixes #8225
Fixes #8226
Fixes #8227
Fixes #8228
Fixes #8229

File:
1 edited

Legend:

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

    r12428 r12547  
    188188                do_action_ref_array( 'bp_invitation_before_save', array( &$this ) );
    189189
    190                 // Update
     190                // Update.
    191191                if ( ! empty( $this->id ) ) {
    192192                        $result = self::_update( $data, array( 'ID' => $this->id ), $data_format, array( '%d' ) );
    193                 // Insert
     193                // Insert.
    194194                } else {
    195195                        $result = self::_insert( $data, $data_format );
    196196                }
    197197
    198                 // Set the invitation ID if successful
     198                // Set the invitation ID if successful.
    199199                if ( ! empty( $result ) && ! is_wp_error( $result ) ) {
    200200                        global $wpdb;
     
    215215                do_action_ref_array( 'bp_invitation_after_save', array( &$this ) );
    216216
    217                 // Return the result
     217                // Return the result.
    218218                return $retval;
    219219        }
     
    347347                $where            = '';
    348348
    349                 // id
     349                // id.
    350350                if ( false !== $args['id'] ) {
    351351                        $id_in = implode( ',', wp_parse_id_list( $args['id'] ) );
     
    353353                }
    354354
    355                 // user_id
     355                // user_id.
    356356                if ( ! empty( $args['user_id'] ) ) {
    357357                        $user_id_in = implode( ',', wp_parse_id_list( $args['user_id'] ) );
     
    365365                }
    366366
    367                 // invitee_email
     367                // invitee_email.
    368368                if ( ! empty( $args['invitee_email'] ) ) {
    369369                        if ( ! is_array( $args['invitee_email'] ) ) {
     
    382382                }
    383383
    384                 // class
     384                // class.
    385385                if ( ! empty( $args['class'] ) ) {
    386386                        if ( ! is_array( $args['class'] ) ) {
     
    399399                }
    400400
    401                 // item_id
     401                // item_id.
    402402                if ( ! empty( $args['item_id'] ) ) {
    403403                        $item_id_in = implode( ',', wp_parse_id_list( $args['item_id'] ) );
     
    405405                }
    406406
    407                 // secondary_item_id
     407                // secondary_item_id.
    408408                if ( ! empty( $args['secondary_item_id'] ) ) {
    409409                        $secondary_item_id_in = implode( ',', wp_parse_id_list( $args['secondary_item_id'] ) );
     
    411411                }
    412412
    413                 // type
     413                // Type.
    414414                if ( ! empty( $args['type'] ) && 'all' !== $args['type'] ) {
    415415                        if ( 'invite' == $args['type'] || 'request' == $args['type'] ) {
     
    432432                }
    433433
    434                 // accepted
     434                // Accepted.
    435435                if ( ! empty( $args['accepted'] ) && 'all' !== $args['accepted'] ) {
    436436                        if ( $args['accepted'] == 'pending' ) {
     
    441441                }
    442442
    443                 // search_terms
     443                // search_terms.
    444444                if ( ! empty( $args['search_terms'] ) ) {
    445445                        $search_terms_like = '%' . bp_esc_like( $args['search_terms'] ) . '%';
     
    447447                }
    448448
    449                 // Custom WHERE
     449                // Custom WHERE.
    450450                if ( ! empty( $where_conditions ) ) {
    451451                        $where = 'WHERE ' . implode( ' AND ', $where_conditions );
     
    468468        protected static function get_order_by_sql( $args = array() ) {
    469469
    470                 // Setup local variable
     470                // Setup local variable.
    471471                $conditions = array();
    472472                $retval     = '';
    473473
    474                 // Order by
     474                // Order by.
    475475                if ( ! empty( $args['order_by'] ) ) {
    476476                        $order_by               = implode( ', ', (array) $args['order_by'] );
     
    478478                }
    479479
    480                 // Sort order direction
     480                // Sort order direction.
    481481                if ( ! empty( $args['sort_order'] ) ) {
    482482                        $sort_order               = bp_esc_sql_order( $args['sort_order'] );
     
    484484                }
    485485
    486                 // Custom ORDER BY
     486                // Custom ORDER BY.
    487487                if ( ! empty( $conditions ) ) {
    488488                        $retval = 'ORDER BY ' . implode( ' ', $conditions );
     
    505505                global $wpdb;
    506506
    507                 // Setup local variable
     507                // Setup local variable.
    508508                $retval = '';
    509509
    510                 // Custom LIMIT
     510                // Custom LIMIT.
    511511                if ( ! empty( $args['page'] ) && ! empty( $args['per_page'] ) ) {
    512512                        $page     = absint( $args['page']     );
     
    565565                );
    566566
    567                 // id
     567                // id.
    568568                if ( ! empty( $args['id'] ) ) {
    569569                        $where_clauses['data']['id'] = absint( $args['id'] );
     
    571571                }
    572572
    573                 // user_id
     573                // user_id.
    574574                if ( ! empty( $args['user_id'] ) ) {
    575575                        $where_clauses['data']['user_id'] = absint( $args['user_id'] );
     
    577577                }
    578578
    579                 // inviter_id
     579                // inviter_id.
    580580                if ( ! empty( $args['inviter_id'] ) ) {
    581581                        $where_clauses['data']['inviter_id'] = absint( $args['inviter_id'] );
     
    583583                }
    584584
    585                 // invitee_email
     585                // invitee_email.
    586586                if ( ! empty( $args['invitee_email'] ) ) {
    587587                        $where_clauses['data']['invitee_email'] = $args['invitee_email'];
     
    589589                }
    590590
    591                 // class
     591                // class.
    592592                if ( ! empty( $args['class'] ) ) {
    593593                        $where_clauses['data']['class'] = $args['class'];
     
    595595                }
    596596
    597                 // item_id
     597                // item_id.
    598598                if ( ! empty( $args['item_id'] ) ) {
    599599                        $where_clauses['data']['item_id'] = absint( $args['item_id'] );
     
    601601                }
    602602
    603                 // secondary_item_id
     603                // secondary_item_id.
    604604                if ( ! empty( $args['secondary_item_id'] ) ) {
    605605                        $where_clauses['data']['secondary_item_id'] = absint( $args['secondary_item_id'] );
     
    607607                }
    608608
    609                 // type
     609                // type.
    610610                if ( ! empty( $args['type'] ) && 'all' !== $args['type'] ) {
    611611                        if ( 'invite' == $args['type'] || 'request' == $args['type'] ) {
     
    630630                }
    631631
    632                 // accepted
     632                // accepted.
    633633                if ( ! empty( $args['accepted'] ) && 'all' !== $args['accepted'] ) {
    634634                        if ( $args['accepted'] == 'pending' ) {
     
    700700         * }
    701701         *
    702          * @return array BP_Invitation objects | IDs of found invit.
     702         * @return array BP_Invitation objects | IDs of found invite.
    703703         */
    704704        public static function get( $args = array() ) {
     
    706706                $invites_table_name = BP_Invitation_Manager::get_table_name();
    707707
    708                 // Parse the arguments
     708                // Parse the arguments.
    709709                $r  = bp_parse_args( $args, array(
    710710                        'id'                => false,
     
    745745                }
    746746
    747                 // WHERE
     747                // WHERE.
    748748                $sql['where'] = self::get_where_sql( array(
    749749                        'id'                => $r['id'],
     
    760760                ) );
    761761
    762                 // ORDER BY
     762                // ORDER BY.
    763763                $sql['orderby'] = self::get_order_by_sql( array(
    764764                        'order_by'   => $r['order_by'],
     
    766766                ) );
    767767
    768                 // LIMIT %d, %d
     768                // LIMIT %d, %d.
    769769                $sql['pagination'] = self::get_paged_sql( array(
    770770                        'page'     => $r['page'],
     
    977977                }
    978978
    979                 // Values to be updated
     979                // Values to be updated.
    980980                $update_args = array(
    981981                        'invite_sent' => 'sent',
    982982                );
    983983
    984                 // WHERE clauses
     984                // WHERE clauses.
    985985                $where_args = array(
    986986                        'id' => $id,
     
    10001000        public static function mark_sent_by_data( $args ) {
    10011001
    1002                 // Values to be updated
     1002                // Values to be updated.
    10031003                $update_args = array(
    10041004                        'invite_sent' => 'sent',
     
    10231023                }
    10241024
    1025                 // Values to be updated
     1025                // Values to be updated.
    10261026                $update_args = array(
    10271027                        'accepted' => 'accepted',
    10281028                );
    10291029
    1030                 // WHERE clauses
     1030                // WHERE clauses.
    10311031                $where_args = array(
    10321032                        'id' => $id,
     
    10461046        public static function mark_accepted_by_data( $args ) {
    10471047
    1048                 // Values to be updated
     1048                // Values to be updated.
    10491049                $update_args = array(
    10501050                        'accepted' => 'accepted',
Note: See TracChangeset for help on using the changeset viewer.