Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/23/2021 02:03:02 AM (4 years ago)
Author:
espellcaste
Message:

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

See #8553

File:
1 edited

Legend:

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

    r10523 r13091  
    142142    /**
    143143     * Constructor method.
    144      *
    145      * @see bp_has_notifications() For information on the array format.
    146144     *
    147145     * @since 1.9.0
     
    171169            'max'               => null,
    172170            'meta_query'        => false,
    173             'date_query'        => false
     171            'date_query'        => false,
    174172        ) );
    175173
    176174        // Sort order direction.
    177175        $orders = array( 'ASC', 'DESC' );
    178         if ( ! empty( $_GET['sort_order'] ) && in_array( $_GET['sort_order'], $orders ) ) {
     176        if ( ! empty( $_GET['sort_order'] ) && in_array( $_GET['sort_order'], $orders, true ) ) {
    179177            $r['sort_order'] = $_GET['sort_order'];
    180178        } else {
     
    184182        // Setup variables.
    185183        $this->pag_arg      = sanitize_key( $r['page_arg'] );
    186         $this->pag_page     = bp_sanitize_pagination_arg( $this->pag_arg, $r['page']     );
    187         $this->pag_num      = bp_sanitize_pagination_arg( 'num',          $r['per_page'] );
     184        $this->pag_page     = bp_sanitize_pagination_arg( $this->pag_arg, $r['page'] );
     185        $this->pag_num      = bp_sanitize_pagination_arg( 'num', $r['per_page'] );
    188186        $this->user_id      = $r['user_id'];
    189187        $this->is_new       = $r['is_new'];
     
    239237                'current'   => $this->pag_page,
    240238                'prev_text' => _x( '←', 'Notifications pagination previous text', 'buddypress' ),
    241                 'next_text' => _x( '→', 'Notifications pagination next text',     'buddypress' ),
     239                'next_text' => _x( '→', 'Notifications pagination next text', 'buddypress' ),
    242240                'mid_size'  => 1,
    243241                'add_args'  => $add_args,
     
    256254     */
    257255    public function has_notifications() {
    258         if ( $this->notification_count ) {
    259             return true;
    260         }
    261 
    262         return false;
     256        return ! empty( $this->notification_count );
    263257    }
    264258
     
    268262     * @since 1.9.0
    269263     *
    270      * @return object The next notification to iterate over.
     264     * @return BP_Notifications_Notification The next notification to iterate over.
    271265     */
    272266    public function next_notification() {
     
    312306            return true;
    313307
    314         } elseif ( $this->current_notification + 1 == $this->notification_count ) {
     308        } elseif ( $this->current_notification + 1 === $this->notification_count ) {
    315309
    316310            /**
     
    319313             * @since 1.9.0
    320314             */
    321             do_action( 'notifications_loop_end');
     315            do_action( 'notifications_loop_end' );
    322316
    323317            $this->rewind_notifications();
Note: See TracChangeset for help on using the changeset viewer.