Make WordPress Core


Ignore:
Timestamp:
10/18/2021 05:51:17 PM (3 years ago)
Author:
hellofromTonya
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/pomo/po.php

    r51636 r51919  
    3737         * @return string msgid/msgstr PO entry for this PO file headers, doesn't contain newline at the end
    3838         */
    39         function export_headers() {
     39        public function export_headers() {
    4040            $header_string = '';
    4141            foreach ( $this->headers as $header => $value ) {
     
    5656         * @return string sequence of mgsgid/msgstr PO strings, doesn't containt newline at the end
    5757         */
    58         function export_entries() {
     58        public function export_entries() {
    5959            // TODO: Sorting.
    6060            return implode( "\n\n", array_map( array( 'PO', 'export_entry' ), $this->entries ) );
     
    6767         * @return string ready for inclusion in PO file string for headers and all the enrtries
    6868         */
    69         function export( $include_headers = true ) {
     69        public function export( $include_headers = true ) {
    7070            $res = '';
    7171            if ( $include_headers ) {
     
    8484         * @return bool true on success, false on error
    8585         */
    86         function export_to_file( $filename, $include_headers = true ) {
     86        public function export_to_file( $filename, $include_headers = true ) {
    8787            $fh = fopen( $filename, 'w' );
    8888            if ( false === $fh ) {
     
    104104         * @param string $text Text to include as a comment.
    105105         */
    106         function set_comment_before_headers( $text ) {
     106        public function set_comment_before_headers( $text ) {
    107107            $this->comments_before_headers = $text;
    108108        }
     
    294294         * @return bool
    295295         */
    296         function import_from_file( $filename ) {
     296        public function import_from_file( $filename ) {
    297297            $f = fopen( $filename, 'r' );
    298298            if ( ! $f ) {
     
    336336         * @return null|false|array
    337337         */
    338         function read_entry( $f, $lineno = 0 ) {
     338        public function read_entry( $f, $lineno = 0 ) {
    339339            $entry = new Translation_Entry();
    340340            // Where were we in the last step.
     
    465465         * @return bool
    466466         */
    467         function read_line( $f, $action = 'read' ) {
     467        public function read_line( $f, $action = 'read' ) {
    468468            static $last_line     = '';
    469469            static $use_last_line = false;
     
    487487         * @param string            $po_comment_line
    488488         */
    489         function add_comment_to_entry( &$entry, $po_comment_line ) {
     489        public function add_comment_to_entry( &$entry, $po_comment_line ) {
    490490            $first_two = substr( $po_comment_line, 0, 2 );
    491491            $comment   = trim( substr( $po_comment_line, 2 ) );
Note: See TracChangeset for help on using the changeset viewer.