Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/26/2021 12:53:27 AM (3 years ago)
Author:
espellcaste
Message:

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

Also, adding several minor PHP changes.

See #8553

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-messages/classes/class-bp-messages-box-template.php

    r12602 r13096  
    44 *
    55 * @package BuddyPress
    6  * @subpackage MessagesTemplate
     6 * @subpackage MessagesClasses
    77 * @since 1.5.0
    88 */
     
    4747     * The thread object currently being iterated on.
    4848     *
    49      * @var object
     49     * @var BP_Messages_Thread|bool
    5050     */
    5151    public $thread = false;
     
    105105     * @param array $args {
    106106     *     Array of arguments. See bp_has_message_threads() for full description.
    107      * }
     107     * }.
    108108     */
    109109    public function __construct( $args = array() ) {
     
    230230     */
    231231    public function has_threads() {
    232         if ( $this->thread_count ) {
    233             return true;
    234         }
    235 
    236         return false;
     232        return ( $this->thread_count );
    237233    }
    238234
     
    240236     * Set up the next member and iterate index.
    241237     *
    242      * @return object The next member to iterate over.
     238     * @return BP_Messages_Thread The next member to iterate over.
    243239     */
    244240    public function next_thread() {
    245241        $this->current_thread++;
    246         $this->thread = $this->threads[$this->current_thread];
     242        $this->thread = $this->threads[ $this->current_thread ];
    247243
    248244        return $this->thread;
     
    270266     * @return bool True if there are more threads to show, otherwise false.
    271267     */
    272     function message_threads() {
     268    public function message_threads() {
    273269        if ( $this->current_thread + 1 < $this->thread_count ) {
    274270            return true;
    275         } elseif ( $this->current_thread + 1 == $this->thread_count ) {
     271        } elseif ( $this->current_thread + 1 === $this->thread_count ) {
    276272
    277273            /**
     
    308304
    309305            // Set up the last message data.
    310             if ( count($this->thread->messages) > 1 ) {
     306            if ( count( $this->thread->messages ) > 1 ) {
    311307                if ( 'inbox' == $this->box ) {
    312308                    foreach ( (array) $this->thread->messages as $key => $message ) {
     
    335331
    336332        // Loop has just started.
    337         if ( 0 == $this->current_thread ) {
     333        if ( 0 === $this->current_thread ) {
    338334
    339335            /**
Note: See TracChangeset for help on using the changeset viewer.