From 20552710463aa9750da5e556e4206926b83d9c7f Mon Sep 17 00:00:00 2001
From: jrfnl <jrfnl@users.noreply.github.com>
Date: Sun, 18 Oct 2020 05:56:59 +0200
Subject: [PATCH] CS: use `self` when appropriate
* `get_default_primary_column_name()` is a protected method, so calling it statically with the class name is bad practice.
* Similarly this applies when calling a `private` constructor.
---
src/wp-admin/includes/class-wp-list-table.php | 2 +-
src/wp-admin/includes/class-wp-screen.php | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/wp-admin/includes/class-wp-list-table.php b/src/wp-admin/includes/class-wp-list-table.php
index 0b20f6be0c..485338e630 100644
a
|
b
|
class WP_List_Table { |
1044 | 1044 | // If the primary column doesn't exist, |
1045 | 1045 | // fall back to the first non-checkbox column. |
1046 | 1046 | if ( ! isset( $columns[ $default ] ) ) { |
1047 | | $default = WP_List_Table::get_default_primary_column_name(); |
| 1047 | $default = self::get_default_primary_column_name(); |
1048 | 1048 | } |
1049 | 1049 | |
1050 | 1050 | /** |
diff --git a/src/wp-admin/includes/class-wp-screen.php b/src/wp-admin/includes/class-wp-screen.php
index 57077ed299..9464fabe05 100644
a
|
b
|
final class WP_Screen { |
377 | 377 | return $screen; |
378 | 378 | } |
379 | 379 | } else { |
380 | | $screen = new WP_Screen(); |
| 380 | $screen = new self(); |
381 | 381 | $screen->id = $id; |
382 | 382 | } |
383 | 383 | |