Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/04/2017 06:26:55 PM (9 years ago)
Author:
tw2113
Message:

Cleanup from recent Scrutinizer review around documentation and param/return types.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/deprecated/1.9.php

    r10108 r11447  
    2020 *
    2121 * @since 1.0.0
    22  * @param string $item_id
    23  * @param int $user_id
    24  * @param string $component_name
    25  * @param string $component_action
    26  * @param string $secondary_item_id
    27  * @param string $date_notified
    28  * @param int $is_new
    29  * @return boolean True on success, false on failure.
     22 * @param string       $item_id
     23 * @param int          $user_id
     24 * @param string       $component_name
     25 * @param string       $component_action
     26 * @param int          $secondary_item_id
     27 * @param false|string $date_notified
     28 * @param int          $is_new
     29 * @return int|boolean True on success, false on failure.
    3030 */
    3131function bp_core_add_notification( $item_id, $user_id, $component_name, $component_action, $secondary_item_id = 0, $date_notified = false, $is_new = 1 ) {
     
    6363 *
    6464 * @since 1.0.0
     65 *
    6566 * @param int $id ID of notification.
    66  * @return boolean True on success, false on failure.
     67 * @return false|integer True on success, false on failure.
    6768 */
    6869function bp_core_delete_notification( $id ) {
     
    8788 * @since 1.0.0
    8889 * @param int $id ID of notification.
    89  * @return BP_Core_Notification
     90 * @return false|BP_Core_Notification
    9091 */
    9192function bp_core_get_notification( $id ) {
     
    141142 * @param string $component_name
    142143 * @param string $component_action
    143  * @return boolean True on success, false on failure.
     144 * @return false|int True on success, false on failure.
    144145 */
    145146function bp_core_delete_notifications_by_type( $user_id, $component_name, $component_action ) {
     
    166167 *
    167168 * @since 1.0.0
     169 *
    168170 * @param int $user_id
    169171 * @param string $component_name
    170172 * @param string $component_action
     173 * @return false|int True on success, false on failure.
     174 */
     175function bp_core_delete_notifications_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false ) {
     176
     177        // Bail if notifications is not active
     178        if ( ! bp_is_active( 'notifications' ) ) {
     179                return false;
     180        }
     181
     182        // Trigger the deprecated function notice
     183        _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_delete_notifications_by_item_id()' );
     184
     185        return bp_notifications_delete_notifications_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id );
     186}
     187
     188/**
     189 * Delete all notifications for by type.
     190 *
     191 * @deprecated Deprecated since BuddyPress 1.9.0. Use
     192 *             bp_notifications_delete_all_notifications_by_type() instead.
     193 *
     194 * @since 1.0.0
     195 *
     196 * @param int          $user_id
     197 * @param string       $component_name
     198 * @param false|string $component_action
    171199 * @return boolean True on success, false on failure.
    172200 */
    173 function bp_core_delete_notifications_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false ) {
    174 
    175         // Bail if notifications is not active
    176         if ( ! bp_is_active( 'notifications' ) ) {
    177                 return false;
    178         }
    179 
    180         // Trigger the deprecated function notice
    181         _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_delete_notifications_by_item_id()' );
    182 
    183         return bp_notifications_delete_notifications_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id );
    184 }
    185 
    186 /**
    187  * Delete all notifications for by type.
    188  *
    189  * @deprecated Deprecated since BuddyPress 1.9.0. Use
    190  *             bp_notifications_delete_all_notifications_by_type() instead.
     201function bp_core_delete_all_notifications_by_type( $item_id, $component_name, $component_action = false, $secondary_item_id = false ) {
     202
     203        // Bail if notifications is not active
     204        if ( ! bp_is_active( 'notifications' ) ) {
     205                return false;
     206        }
     207
     208        // Trigger the deprecated function notice
     209        _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_delete_all_notifications_by_type()' );
     210
     211        bp_notifications_delete_all_notifications_by_type( $item_id, $component_name, $component_action, $secondary_item_id );
     212}
     213
     214/**
     215 * Delete all notifications for a user.
     216 *
     217 * Used when clearing out all notifications for a user, when deleted or spammed
     218 *
     219 * @deprecated Deprecated since BuddyPress 1.9.0. Use
     220 *             bp_notifications_delete_notifications_from_user() instead.
    191221 *
    192222 * @since 1.0.0
     
    194224 * @param string $component_name
    195225 * @param string $component_action
    196  * @return boolean True on success, false on failure.
    197  */
    198 function bp_core_delete_all_notifications_by_type( $item_id, $component_name, $component_action = false, $secondary_item_id = false ) {
    199 
    200         // Bail if notifications is not active
    201         if ( ! bp_is_active( 'notifications' ) ) {
    202                 return false;
    203         }
    204 
    205         // Trigger the deprecated function notice
    206         _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_delete_all_notifications_by_type()' );
    207 
    208         bp_notifications_delete_all_notifications_by_type( $item_id, $component_name, $component_action, $secondary_item_id );
    209 }
    210 
    211 /**
    212  * Delete all notifications for a user.
    213  *
    214  * Used when clearing out all notifications for a user, when deleted or spammed
    215  *
    216  * @deprecated Deprecated since BuddyPress 1.9.0. Use
    217  *             bp_notifications_delete_notifications_from_user() instead.
    218  *
    219  * @since 1.0.0
    220  * @param int $user_id
    221  * @param string $component_name
    222  * @param string $component_action
    223  * @return boolean True on success, false on failure.
     226 * @return false|int True on success, false on failure.
    224227 */
    225228function bp_core_delete_notifications_from_user( $user_id, $component_name, $component_action ) {
Note: See TracChangeset for help on using the changeset viewer.