Skip to:
Content

bbPress.org

Ticket #3294: trac-3294-phpcs-fix-class-instantiation.patch

File trac-3294-phpcs-fix-class-instantiation.patch, 3.2 KB (added by jrf, 20 months ago)

Fixes all violations against the WordPress.Classes.ClassInstantiation.MissingParenthesis error code

  • src/bbpress.php

     
    113113
    114114                // Only run these methods if they haven't been ran previously
    115115                if ( null === $instance ) {
    116                         $instance = new bbPress;
     116                        $instance = new bbPress();
    117117                        $instance->setup_environment();
    118118                        $instance->includes();
    119119                        $instance->setup_variables();
     
    812812                $class_name = "BBP_User_Engagements_{$strategy}";
    813813
    814814                // Setup the engagements interface
    815                 $this->engagements = new $class_name;
     815                $this->engagements = new $class_name();
    816816        }
    817817
    818818        /**
  • src/includes/admin/tools/converter.php

     
    9191
    9292                // Try to instantiate the converter object
    9393                if ( class_exists( $platform ) ) {
    94                         $converter = new $platform;
     94                        $converter = new $platform();
    9595                }
    9696        }
    9797
  • src/includes/extend/buddypress/loader.php

     
    146146        public function setup_components() {
    147147
    148148                // Always load the members component
    149                 bbpress()->extend->buddypress->members = new BBP_BuddyPress_Members;
     149                bbpress()->extend->buddypress->members = new BBP_BuddyPress_Members();
    150150
    151151                // Create new activity class
    152152                if ( bp_is_active( 'activity' ) ) {
    153                         bbpress()->extend->buddypress->activity = new BBP_BuddyPress_Activity;
     153                        bbpress()->extend->buddypress->activity = new BBP_BuddyPress_Activity();
    154154                }
    155155
    156156                // Register the group extension only if groups are active
  • src/includes/replies/template.php

     
    235235
    236236                // Figure out total pages
    237237                if ( true === $r['hierarchical'] ) {
    238                         $walker      = new BBP_Walker_Reply;
     238                        $walker      = new BBP_Walker_Reply();
    239239                        $total_pages = ceil( $walker->get_number_of_root_elements( $bbp->reply_query->posts ) / $bbp->reply_query->posts_per_page );
    240240                } else {
    241241
     
    23732373
    23742374                // We are threading replies
    23752375                if ( bbp_thread_replies() ) {
    2376                         $walker  = new BBP_Walker_Reply;
     2376                        $walker  = new BBP_Walker_Reply();
    23772377                        $threads = absint( $walker->get_number_of_root_elements( $bbp->reply_query->posts ) - 1 );
    23782378                        $retstr  = sprintf( _n( 'Viewing %1$s reply thread', 'Viewing %1$s reply threads', $threads, 'bbpress' ), bbp_number_format( $threads ) );
    23792379
  • src/includes/replies/functions.php

     
    23872387
    23882388        // Parse arguments
    23892389        $r = bbp_parse_args( $args, array(
    2390                 'walker'       => new BBP_Walker_Reply,
     2390                'walker'       => new BBP_Walker_Reply(),
    23912391                'max_depth'    => bbp_thread_replies_depth(),
    23922392                'style'        => 'ul',
    23932393                'callback'     => null,