Coding Standards: Add public visibility to methods in src directory.

This commit adds the `public` visibility keyword to each method which did not have an explicit visibility keyword.

Why `public`?

With no visibility previously declared, these methods are implicitly `public` and available for use. Changing them to anything else would be a backwards-compatibility break.

Props costdev, jrf.
See #54177.

git-svn-id: https://develop.svn.wordpress.org/trunk@51919 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Tonya Mork
2021-10-18 17:51:17 +00:00
parent 4dae388d32
commit b0cc77854f
13 changed files with 100 additions and 100 deletions

View File

@@ -13,7 +13,7 @@ class WP_Debug_Data {
*
* @since 5.2.0
*/
static function check_for_updates() {
public static function check_for_updates() {
wp_version_check();
wp_update_plugins();
wp_update_themes();
@@ -32,7 +32,7 @@ class WP_Debug_Data {
*
* @return array The debug data for the site.
*/
static function debug_data() {
public static function debug_data() {
global $wpdb;
// Save few function calls.

View File

@@ -156,7 +156,7 @@ class WP_Site_Health_Auto_Updates {
*
* @return array|false The test results. False if the auto-updates failed.
*/
function test_if_failed_update() {
public function test_if_failed_update() {
$failed = get_site_option( 'auto_core_update_failed' );
if ( ! $failed ) {
@@ -272,7 +272,7 @@ class WP_Site_Health_Auto_Updates {
*
* @return array The test results.
*/
function test_check_wp_filesystem_method() {
public function test_check_wp_filesystem_method() {
// Make sure the `request_filesystem_credentials()` function is available during our REST API call.
if ( ! function_exists( 'request_filesystem_credentials' ) ) {
require_once ABSPATH . '/wp-admin/includes/file.php';
@@ -306,7 +306,7 @@ class WP_Site_Health_Auto_Updates {
*
* @return array|false The test results. False if they're not writeable.
*/
function test_all_files_writable() {
public function test_all_files_writable() {
global $wp_filesystem;
require ABSPATH . WPINC . '/version.php'; // $wp_version; // x.y.z
@@ -391,7 +391,7 @@ class WP_Site_Health_Auto_Updates {
*
* @return array|false The test results. False if it isn't a development version.
*/
function test_accepts_dev_updates() {
public function test_accepts_dev_updates() {
require ABSPATH . WPINC . '/version.php'; // $wp_version; // x.y.z
// Only for dev versions.
if ( false === strpos( $wp_version, '-' ) ) {
@@ -429,7 +429,7 @@ class WP_Site_Health_Auto_Updates {
*
* @return array The test results.
*/
function test_accepts_minor_updates() {
public function test_accepts_minor_updates() {
if ( defined( 'WP_AUTO_UPDATE_CORE' ) && false === WP_AUTO_UPDATE_CORE ) {
return array(
'description' => sprintf(

View File

@@ -2767,7 +2767,7 @@ class WP_Site_Health {
*
* @return object The test results.
*/
function detect_plugin_theme_auto_update_issues() {
public function detect_plugin_theme_auto_update_issues() {
$mock_plugin = (object) array(
'id' => 'w.org/plugins/a-fake-plugin',
'slug' => 'a-fake-plugin',
@@ -2850,7 +2850,7 @@ class WP_Site_Health {
*
* @return object The test results.
*/
function can_perform_loopback() {
public function can_perform_loopback() {
$body = array( 'site-health' => 'loopback-test' );
$cookies = wp_unslash( $_COOKIE );
$timeout = 10;