Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/25/2013 02:28:28 AM (12 years ago)
Author:
johnjamesjacoby
Message:

Fix some PHP 5.4 static method E_STRICT warnings across several components. More to do here. See #5108.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-classes.php

    r7228 r7308  
    2626    var $is_spam;
    2727
    28     function __construct( $id = false ) {
     28    public function __construct( $id = false ) {
    2929        if ( !empty( $id ) ) {
    3030            $this->id = $id;
     
    3333    }
    3434
    35     function populate() {
     35    public function populate() {
    3636        global $wpdb, $bp;
    3737
     
    5656    }
    5757
    58     function save() {
    59         global $wpdb, $bp, $current_user;
     58    public function save() {
     59        global $wpdb, $bp;
    6060
    6161        $this->id                = apply_filters_ref_array( 'bp_activity_id_before_save',                array( $this->id,                &$this ) );
     
    113113     * @return array
    114114     */
    115     function get( $args = array() ) {
     115    public static function get( $args = array() ) {
    116116        global $wpdb, $bp;
    117117
     
    350350     * @since BuddyPress (1.2)
    351351     */
    352     function get_specific( $activity_ids, $max = false, $page = 1, $per_page = 25, $sort = 'DESC', $display_comments = false ) {
     352    public static function get_specific( $activity_ids, $max = false, $page = 1, $per_page = 25, $sort = 'DESC', $display_comments = false ) {
    353353        _deprecated_function( __FUNCTION__, '1.5', 'Use BP_Activity_Activity::get() with the "in" parameter instead.' );
    354354        return BP_Activity_Activity::get( $max, $page, $per_page, $sort, false, false, $display_comments, false, false, $activity_ids );
    355355    }
    356356
    357     function get_id( $user_id, $component, $type, $item_id, $secondary_item_id, $action, $content, $date_recorded ) {
     357    public static function get_id( $user_id, $component, $type, $item_id, $secondary_item_id, $action, $content, $date_recorded ) {
    358358        global $bp, $wpdb;
    359359
     
    392392    }
    393393
    394     function delete( $args ) {
     394    public static function delete( $args = array() ) {
    395395        global $wpdb, $bp;
    396396
     
    467467    }
    468468
    469     function delete_activity_item_comments( $activity_ids = array() ) {
     469    public static function delete_activity_item_comments( $activity_ids = array() ) {
    470470        global $bp, $wpdb;
    471471
     
    475475    }
    476476
    477     function delete_activity_meta_entries( $activity_ids = array() ) {
     477    public static function delete_activity_meta_entries( $activity_ids = array() ) {
    478478        global $bp, $wpdb;
    479479
     
    496496     * @since BuddyPress (1.2)
    497497     */
    498     function append_comments( $activities, $spam = 'ham_only' ) {
    499         global $wpdb;
    500 
     498    public static function append_comments( $activities, $spam = 'ham_only' ) {
    501499        $activity_comments = array();
    502500
     
    528526     * @since BuddyPress (1.2)
    529527     */
    530     function get_activity_comments( $activity_id, $left, $right, $spam = 'ham_only', $top_level_parent_id = 0 ) {
     528    public static function get_activity_comments( $activity_id, $left, $right, $spam = 'ham_only', $top_level_parent_id = 0 ) {
    531529        global $wpdb, $bp;
    532530
     
    585583    }
    586584
    587     function rebuild_activity_comment_tree( $parent_id, $left = 1 ) {
     585    public static function rebuild_activity_comment_tree( $parent_id, $left = 1 ) {
    588586        global $wpdb, $bp;
    589587
     
    609607    }
    610608
    611     function get_child_comments( $parent_id ) {
     609    public static function get_child_comments( $parent_id ) {
    612610        global $bp, $wpdb;
    613611
     
    620618     * @return array
    621619     */
    622     function get_recorded_components() {
     620    public static function get_recorded_components() {
    623621        global $wpdb, $bp;
    624622        return $wpdb->get_col( "SELECT DISTINCT component FROM {$bp->activity->table_name} ORDER BY component ASC" );
    625623    }
    626624
    627     function get_sitewide_items_for_feed( $limit = 35 ) {
    628         global $bp;
    629 
     625    public static function get_sitewide_items_for_feed( $limit = 35 ) {
    630626        $activities    = bp_activity_get_sitewide( array( 'max' => $limit ) );
    631627        $activity_feed = array();
     
    642638    }
    643639
    644     function get_in_operator_sql( $field, $items ) {
     640    public static function get_in_operator_sql( $field, $items ) {
    645641        global $wpdb;
    646642
     
    666662    }
    667663
    668     function get_filter_sql( $filter_array ) {
     664    public static function get_filter_sql( $filter_array ) {
    669665
    670666        $filter_sql = array();
     
    706702    }
    707703
    708     function get_last_updated() {
     704    public static function get_last_updated() {
    709705        global $bp, $wpdb;
    710706
     
    712708    }
    713709
    714     function total_favorite_count( $user_id ) {
     710    public static function total_favorite_count( $user_id ) {
    715711        if ( !$favorite_activity_entries = bp_get_user_meta( $user_id, 'bp_favorite_activities', true ) )
    716712            return 0;
     
    719715    }
    720716
    721     function check_exists_by_content( $content ) {
     717    public static function check_exists_by_content( $content ) {
    722718        global $wpdb, $bp;
    723719
     
    725721    }
    726722
    727     function hide_all_for_user( $user_id ) {
     723    public static function hide_all_for_user( $user_id ) {
    728724        global $wpdb, $bp;
    729725
Note: See TracChangeset for help on using the changeset viewer.