Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/26/2021 12:53:27 AM (5 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-notice.php

    r11293 r13096  
    1919 */
    2020class BP_Messages_Notice {
     21
    2122        /**
    2223         * The notice ID.
    2324         *
     25         * @var int|null
     26         */
     27        public $id = null;
     28
     29        /**
     30         * The subject line for the notice.
     31         *
     32         * @var string
     33         */
     34        public $subject;
     35
     36        /**
     37         * The content of the notice.
     38         *
     39         * @var string
     40         */
     41        public $message;
     42
     43        /**
     44         * The date the notice was created.
     45         *
     46         * @var string
     47         */
     48        public $date_sent;
     49
     50        /**
     51         * Whether the notice is active or not.
     52         *
    2453         * @var int
    2554         */
    26         public $id = null;
    27 
    28         /**
    29          * The subject line for the notice.
    30          *
    31          * @var string
    32          */
    33         public $subject;
    34 
    35         /**
    36          * The content of the notice.
    37          *
    38          * @var string
    39          */
    40         public $message;
    41 
    42         /**
    43          * The date the notice was created.
    44          *
    45          * @var string
    46          */
    47         public $date_sent;
    48 
    49         /**
    50          * Whether the notice is active or not.
    51          *
    52          * @var int
    53          */
    5455        public $is_active;
    5556
     
    6263         */
    6364        public function __construct( $id = null ) {
    64                 if ( $id ) {
     65                if ( ! empty( $id ) ) {
    6566                        $this->id = (int) $id;
    6667                        $this->populate();
     
    7273         *
    7374         * Runs during constructor.
     75         *
     76         * @global BuddyPress $bp The one true BuddyPress instance.
     77         * @global wpdb $wpdb WordPress database object.
    7478         *
    7579         * @since 1.0.0
     
    9397         * Saves a notice.
    9498         *
     99         * @global BuddyPress $bp The one true BuddyPress instance.
     100         * @global wpdb $wpdb WordPress database object.
     101         *
    95102         * @since 1.0.0
    96103         *
     
    174181         * Deletes a notice.
    175182         *
     183         * @global BuddyPress $bp The one true BuddyPress instance.
     184         * @global wpdb $wpdb WordPress database object.
     185         *
    176186         * @since 1.0.0
    177187         *
     
    215225         *
    216226         * To get all notices, pass a value of -1 to pag_num.
     227         *
     228         * @global BuddyPress $bp The one true BuddyPress instance.
     229         * @global wpdb $wpdb WordPress database object.
    217230         *
    218231         * @since 1.0.0
     
    223236         *     @type int $pag_page The page number.  Defaults to 1.
    224237         * }
    225          * @return object List of notices to display.
     238         * @return array List of notices to display.
    226239         */
    227240        public static function get_notices( $args = array() ) {
     
    253266                 * @since 2.8.0
    254267                 *
    255                  * @param array $r Array of parameters.
     268                 * @param array $notices List of notices sorted by date and paginated.
     269                 * @param array $r       Array of parameters.
    256270                 */
    257271                return apply_filters( 'messages_notice_get_notices', $notices, $r );
     
    261275         * Returns the total number of recorded notices.
    262276         *
     277         * @global BuddyPress $bp The one true BuddyPress instance.
     278         * @global wpdb $wpdb WordPress database object.
     279         *
    263280         * @since 1.0.0
    264281         *
     
    276293                 *
    277294                 * @since 2.8.0
    278                  */
    279                 return (int) apply_filters( 'messages_notice_get_total_notice_count', $notice_count );
     295                 *
     296                 * @param int $notice_count Total number of recorded notices.
     297                 */
     298                return apply_filters( 'messages_notice_get_total_notice_count', (int) $notice_count );
    280299        }
    281300
     
    283302         * Returns the active notice that should be displayed on the front end.
    284303         *
    285          * @since 1.0.0
    286          *
    287          * @return object The BP_Messages_Notice object.
     304         * @global BuddyPress $bp The one true BuddyPress instance.
     305         * @global wpdb $wpdb WordPress database object.
     306         *
     307         * @since 1.0.0
     308         *
     309         * @return BP_Messages_Notice
    288310         */
    289311        public static function get_active() {
     
    305327                 *
    306328                 * @since 2.8.0
     329                 *
     330                 * @param BP_Messages_Notice $notice The notice object.
    307331                 */
    308332                return apply_filters( 'messages_notice_get_active', $notice );
Note: See TracChangeset for help on using the changeset viewer.