Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/11/2021 05:26:17 PM (3 years ago)
Author:
espellcaste
Message:

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

Also, adding several minor PHP changes.

See #8553

File:
1 edited

Legend:

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

    r12852 r13105  
    111111     *
    112112     * @since 1.5.0
    113      * @since 7.0.0 Added $xprofile_query parameter. Added $user_ids parameter.
     113     * @since 7.0.0 Added `$xprofile_query` parameter. Added `$user_ids` parameter.
    114114     *
    115115     * @see BP_User_Query for an in-depth description of parameters.
    116116     *
    117      * @param array $args {
     117     * @param array ...$args {
    118118     *     Array of arguments. Supports all arguments of BP_User_Query. Additional
    119119     *     arguments, or those with different defaults, are described below.
     
    268268     * @return bool True if there are items in the loop, otherwise false.
    269269     */
    270     function has_members() {
    271         if ( $this->member_count )
    272             return true;
    273 
    274         return false;
     270    public function has_members() {
     271        return ! empty( $this->member_count );
    275272    }
    276273
     
    282279     * @return object The next member to iterate over.
    283280     */
    284     function next_member() {
     281    public function next_member() {
    285282        $this->current_member++;
    286         $this->member = $this->members[$this->current_member];
     283        $this->member = $this->members[ $this->current_member ];
    287284
    288285        return $this->member;
     
    294291     * @since 1.0.0
    295292     */
    296     function rewind_members() {
     293    public function rewind_members() {
    297294        $this->current_member = -1;
    298295        if ( $this->member_count > 0 ) {
     
    314311     * @return bool True if there are more members to show, otherwise false.
    315312     */
    316     function members() {
     313    public function members() {
    317314        if ( $this->current_member + 1 < $this->member_count ) {
    318315            return true;
    319         } elseif ( $this->current_member + 1 == $this->member_count ) {
     316        } elseif ( $this->current_member + 1 === $this->member_count ) {
    320317
    321318            /**
     
    344341     * @see bp_the_member()
    345342     */
    346     function the_member() {
    347 
     343    public function the_member() {
    348344        $this->in_the_loop = true;
    349345        $this->member      = $this->next_member();
    350346
    351347        // Loop has just started.
    352         if ( 0 == $this->current_member ) {
     348        if ( 0 === $this->current_member ) {
    353349
    354350            /**
     
    359355            do_action( 'member_loop_start' );
    360356        }
    361 
    362357    }
    363358}
Note: See TracChangeset for help on using the changeset viewer.