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
@@ -17,7 +17,7 @@ class Twenty_Eleven_Ephemera_Widget extends WP_Widget {
*
* @since Twenty Eleven 2.2
*/
function __construct() {
public function __construct() {
parent::__construct(
'widget_twentyeleven_ephemera',
__( 'Twenty Eleven Ephemera', 'twentyeleven' ),
@@ -40,7 +40,7 @@ class Twenty_Eleven_Ephemera_Widget extends WP_Widget {
* @since Twenty Eleven 1.0
* @deprecated Twenty Eleven 2.2
*/
function Twenty_Eleven_Ephemera_Widget() {
public function Twenty_Eleven_Ephemera_Widget() {
self::__construct();
}
@@ -52,7 +52,7 @@ class Twenty_Eleven_Ephemera_Widget extends WP_Widget {
* @param array $args An array of standard parameters for widgets in this theme.
* @param array $instance An array of settings for this widget instance.
*/
function widget( $args, $instance ) {
public function widget( $args, $instance ) {
$cache = wp_cache_get( 'widget_twentyeleven_ephemera', 'widget' );
if ( ! is_array( $cache ) ) {
@@ -158,7 +158,7 @@ class Twenty_Eleven_Ephemera_Widget extends WP_Widget {
*
* @since Twenty Eleven 1.0
*/
function update( $new_instance, $old_instance ) {
public function update( $new_instance, $old_instance ) {
$instance = $old_instance;
$instance['title'] = strip_tags( $new_instance['title'] );
$instance['number'] = (int) $new_instance['number'];
@@ -177,7 +177,7 @@ class Twenty_Eleven_Ephemera_Widget extends WP_Widget {
*
* @since Twenty Eleven 1.0
*/
function flush_widget_cache() {
public function flush_widget_cache() {
wp_cache_delete( 'widget_twentyeleven_ephemera', 'widget' );
}
@@ -188,7 +188,7 @@ class Twenty_Eleven_Ephemera_Widget extends WP_Widget {
*
* @since Twenty Eleven 1.0
*/
function form( $instance ) {
public function form( $instance ) {
$title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
$number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 10;
?>
@@ -269,7 +269,7 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget {
* @param array $old_instance Original widget instance.
* @return array Updated widget instance.
*/
function update( $new_instance, $old_instance ) {
public function update( $new_instance, $old_instance ) {
$old_instance['title'] = strip_tags( $new_instance['title'] );
$old_instance['number'] = empty( $new_instance['number'] ) ? 2 : absint( $new_instance['number'] );
@@ -287,7 +287,7 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget {
*
* @param array $instance
*/
function form( $instance ) {
public function form( $instance ) {
$title = ! empty( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
$number = ! empty( $instance['number'] ) ? absint( $instance['number'] ) : 2;
$format = isset( $instance['format'] ) ? $instance['format'] : '';