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/mo.php

    r51342 r51919  
    3838         * @return bool True if the import from file was successful, otherwise false.
    3939         */
    40         function import_from_file( $filename ) {
     40        public function import_from_file( $filename ) {
    4141            $reader = new POMO_FileReader( $filename );
    4242
     
    5454         * @return bool
    5555         */
    56         function export_to_file( $filename ) {
     56        public function export_to_file( $filename ) {
    5757            $fh = fopen( $filename, 'wb' );
    5858            if ( ! $fh ) {
     
    6767         * @return string|false
    6868         */
    69         function export() {
     69        public function export() {
    7070            $tmp_fh = fopen( 'php://temp', 'r+' );
    7171            if ( ! $tmp_fh ) {
     
    8181         * @return bool
    8282         */
    83         function is_entry_good_for_export( $entry ) {
     83        public function is_entry_good_for_export( $entry ) {
    8484            if ( empty( $entry->translations ) ) {
    8585                return false;
     
    9797         * @return true
    9898         */
    99         function export_to_file_handle( $fh ) {
     99        public function export_to_file_handle( $fh ) {
    100100            $entries = array_filter( $this->entries, array( $this, 'is_entry_good_for_export' ) );
    101101            ksort( $entries );
     
    158158         * @return string
    159159         */
    160         function export_original( $entry ) {
     160        public function export_original( $entry ) {
    161161            // TODO: Warnings for control characters.
    162162            $exported = $entry->singular;
     
    174174         * @return string
    175175         */
    176         function export_translations( $entry ) {
     176        public function export_translations( $entry ) {
    177177            // TODO: Warnings for control characters.
    178178            return $entry->is_plural ? implode( "\0", $entry->translations ) : $entry->translations[0];
     
    182182         * @return string
    183183         */
    184         function export_headers() {
     184        public function export_headers() {
    185185            $exported = '';
    186186            foreach ( $this->headers as $header => $value ) {
     
    194194         * @return string|false
    195195         */
    196         function get_byteorder( $magic ) {
     196        public function get_byteorder( $magic ) {
    197197            // The magic is 0x950412de.
    198198
     
    215215         * @return bool True if the import was successful, otherwise false.
    216216         */
    217         function import_from_reader( $reader ) {
     217        public function import_from_reader( $reader ) {
    218218            $endian_string = MO::get_byteorder( $reader->readint32() );
    219219            if ( false === $endian_string ) {
     
    312312         * @return Translation_Entry Entry instance.
    313313         */
    314         function &make_entry( $original, $translation ) {
     314        public function &make_entry( $original, $translation ) {
    315315            $entry = new Translation_Entry();
    316316            // Look for context, separated by \4.
     
    336336         * @return string
    337337         */
    338         function select_plural_form( $count ) {
     338        public function select_plural_form( $count ) {
    339339            return $this->gettext_select_plural_form( $count );
    340340        }
     
    343343         * @return int
    344344         */
    345         function get_plural_forms_count() {
     345        public function get_plural_forms_count() {
    346346            return $this->_nplurals;
    347347        }
Note: See TracChangeset for help on using the changeset viewer.