Skip to content

Commit e50c65c

Browse files
Coding Standards: Always use parentheses when instantiating an object.
Note: This will be enforced by WPCS 3.0.0. Props jrf. See #56791. git-svn-id: https://develop.svn.wordpress.org/trunk@54891 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 6821cb0 commit e50c65c

86 files changed

Lines changed: 166 additions & 166 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/wp-admin/customize.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
}
9898

9999
$registered = $wp_scripts->registered;
100-
$wp_scripts = new WP_Scripts;
100+
$wp_scripts = new WP_Scripts();
101101
$wp_scripts->registered = $registered;
102102

103103
add_action( 'customize_controls_print_scripts', 'print_head_scripts', 20 );

src/wp-admin/includes/ajax-actions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1570,7 +1570,7 @@ function wp_ajax_add_menu_item() {
15701570
'before' => '',
15711571
'link_after' => '',
15721572
'link_before' => '',
1573-
'walker' => new $walker_class_name,
1573+
'walker' => new $walker_class_name(),
15741574
);
15751575

15761576
echo walk_nav_menu_tree( $menu_items, 0, (object) $args );

src/wp-admin/includes/bookmark.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function edit_link( $link_id = 0 ) {
5959
* @return stdClass Default link object.
6060
*/
6161
function get_default_link_to_edit() {
62-
$link = new stdClass;
62+
$link = new stdClass();
6363
if ( isset( $_GET['linkurl'] ) ) {
6464
$link->link_url = esc_url( wp_unslash( $_GET['linkurl'] ) );
6565
} else {

src/wp-admin/includes/class-language-pack-upgrader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public static function async_upgrade( $upgrader = false ) {
6262
* Avoid messing with VCS installations, at least for now.
6363
* Noted: this is not the ideal way to accomplish this.
6464
*/
65-
$check_vcs = new WP_Automatic_Updater;
65+
$check_vcs = new WP_Automatic_Updater();
6666
if ( $check_vcs->is_vcs_checkout( WP_CONTENT_DIR ) ) {
6767
return;
6868
}

src/wp-admin/includes/class-wp-automatic-updater.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public function is_vcs_checkout( $context ) {
139139
*/
140140
public function should_update( $type, $item, $context ) {
141141
// Used to see if WP_Filesystem is set up to allow unattended updates.
142-
$skin = new Automatic_Upgrader_Skin;
142+
$skin = new Automatic_Upgrader_Skin();
143143

144144
if ( $this->is_disabled() ) {
145145
return false;
@@ -305,7 +305,7 @@ protected function send_core_update_notification_email( $item ) {
305305
* @return null|WP_Error
306306
*/
307307
public function update( $type, $item ) {
308-
$skin = new Automatic_Upgrader_Skin;
308+
$skin = new Automatic_Upgrader_Skin();
309309

310310
switch ( $type ) {
311311
case 'core':

src/wp-admin/includes/class-wp-site-health-auto-updates.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ public function test_check_wp_filesystem_method() {
280280
require_once ABSPATH . 'wp-admin/includes/file.php';
281281
}
282282

283-
$skin = new Automatic_Upgrader_Skin;
283+
$skin = new Automatic_Upgrader_Skin();
284284
$success = $skin->request_filesystem_credentials( false, ABSPATH );
285285

286286
if ( ! $success ) {
@@ -313,7 +313,7 @@ public function test_all_files_writable() {
313313

314314
require ABSPATH . WPINC . '/version.php'; // $wp_version; // x.y.z
315315

316-
$skin = new Automatic_Upgrader_Skin;
316+
$skin = new Automatic_Upgrader_Skin();
317317
$success = $skin->request_filesystem_credentials( false, ABSPATH );
318318

319319
if ( ! $success ) {

src/wp-admin/includes/image-edit.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ function wp_restore_image( $post_id ) {
739739
$backup_sizes = get_post_meta( $post_id, '_wp_attachment_backup_sizes', true );
740740
$old_backup_sizes = $backup_sizes;
741741
$restored = false;
742-
$msg = new stdClass;
742+
$msg = new stdClass();
743743

744744
if ( ! is_array( $backup_sizes ) ) {
745745
$msg->error = __( 'Cannot load image metadata.' );
@@ -827,7 +827,7 @@ function wp_restore_image( $post_id ) {
827827
function wp_save_image( $post_id ) {
828828
$_wp_additional_image_sizes = wp_get_additional_image_sizes();
829829

830-
$return = new stdClass;
830+
$return = new stdClass();
831831
$success = false;
832832
$delete = false;
833833
$scaled = false;

src/wp-admin/includes/nav-menu.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function _wp_ajax_menu_quick_search( $request = array() ) {
3232
}
3333

3434
if ( 'markup' === $response_format ) {
35-
$args['walker'] = new Walker_Nav_Menu_Checklist;
35+
$args['walker'] = new Walker_Nav_Menu_Checklist();
3636
}
3737

3838
if ( 'get-post-item' === $type ) {
@@ -429,14 +429,14 @@ function wp_nav_menu_item_post_type_meta_box( $data_object, $box ) {
429429
}
430430

431431
// @todo Transient caching of these results with proper invalidation on updating of a post of this type.
432-
$get_posts = new WP_Query;
432+
$get_posts = new WP_Query();
433433
$posts = $get_posts->query( $args );
434434

435435
// Only suppress and insert when more than just suppression pages available.
436436
if ( ! $get_posts->post_count ) {
437437
if ( ! empty( $suppress_page_ids ) ) {
438438
unset( $args['post__not_in'] );
439-
$get_posts = new WP_Query;
439+
$get_posts = new WP_Query();
440440
$posts = $get_posts->query( $args );
441441
} else {
442442
echo '<p>' . __( 'No items.' ) . '</p>';
@@ -1059,7 +1059,7 @@ function wp_get_nav_menu_to_edit( $menu_id = 0 ) {
10591059
$walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $menu_id );
10601060

10611061
if ( class_exists( $walker_class_name ) ) {
1062-
$walker = new $walker_class_name;
1062+
$walker = new $walker_class_name();
10631063
} else {
10641064
return new WP_Error(
10651065
'menu_walker_not_exist',

src/wp-admin/includes/post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ function get_default_post_to_edit( $post_type = 'post', $create_in_db = false )
716716
wp_schedule_event( time(), 'daily', 'wp_scheduled_auto_draft_delete' );
717717
}
718718
} else {
719-
$post = new stdClass;
719+
$post = new stdClass();
720720
$post->ID = 0;
721721
$post->post_author = '';
722722
$post->post_date = '';

src/wp-admin/includes/privacy-tools.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) {
535535
wp_delete_file( $archive_pathname );
536536
}
537537

538-
$zip = new ZipArchive;
538+
$zip = new ZipArchive();
539539
if ( true === $zip->open( $archive_pathname, ZipArchive::CREATE ) ) {
540540
if ( ! $zip->addFile( $json_report_pathname, 'export.json' ) ) {
541541
$error = __( 'Unable to archive the personal data export file (JSON format).' );

0 commit comments

Comments
 (0)