Make WordPress Core

Changeset 57344


Ignore:
Timestamp:
01/24/2024 07:55:53 AM (3 years ago)
Author:
swissspidy
Message:

I18N: Improve docblocks after [57337].

Props mukesh27.
See #59656.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-textdomain-registry.php

    r57303 r57344  
    226226         *     }
    227227         * }
    228          * @return void
    229228         */
    230229        public function invalidate_mo_files_cache( $upgrader, $hook_extra ) {
  • trunk/src/wp-includes/l10n/class-wp-translation-file.php

    r57337 r57344  
    285285        abstract protected function parse_file();
    286286
    287 
    288287        /**
    289288         * Exports translation contents as a string.
  • trunk/src/wp-includes/l10n/class-wp-translations.php

    r57337 r57344  
    8181         * @since 6.5.0
    8282         *
    83          * @param string $original    Original string to translate from MO file. Might contain
    84          *                            0x04 as context separator or 0x00 as singular/plural separator.
     83         * @param string $original     Original string to translate from MO file. Might contain
     84         *                             0x04 as context separator or 0x00 as singular/plural separator.
    8585         * @param string $translations Translation strings from MO file.
    8686         * @return Translation_Entry Entry instance.
  • trunk/tests/phpunit/tests/l10n/wpTranslationController.php

    r57339 r57344  
    66 */
    77class WP_Translation_Controller_Tests extends WP_UnitTestCase {
    8         /**
    9          * @return void
    10          */
    118        public function tear_down() {
    129                remove_all_filters( 'translation_file_format' );
     
    2219         * @covers WP_Translation_Controller::get_headers
    2320         * @covers WP_Translation_Controller::normalize_header
    24          *
    25          * @return void
    2621         */
    2722        public function test_load_textdomain() {
     
    7469         * @covers WP_Translation_Controller::get_headers
    7570         * @covers WP_Translation_Controller::normalize_header
    76          *
    77          * @return void
    7871         */
    7972        public function test_load_textdomain_existing_override() {
     
    9487        /**
    9588         * @covers ::load_textdomain
    96          *
    97          * @return void
    9889         */
    9990        public function test_load_textdomain_php_files() {
     
    10899        /**
    109100         * @covers ::load_textdomain
    110          *
    111          * @return void
    112101         */
    113102        public function test_load_textdomain_prefers_php_files_by_default() {
     
    132121        /**
    133122         * @covers ::load_textdomain
    134          *
    135          * @return void
    136123         */
    137124        public function test_load_textdomain_reads_php_files_if_filtered_format_is_unsupported() {
     
    159146        /**
    160147         * @covers ::load_textdomain
    161          *
    162          * @return void
    163148         */
    164149        public function test_load_textdomain_existing_translation_is_kept() {
     
    184169        /**
    185170         * @covers ::load_textdomain
    186          *
    187          * @return void
    188171         */
    189172        public function test_load_textdomain_loads_existing_translation() {
     
    206189        /**
    207190         * @covers ::load_textdomain
    208          *
    209          * @return void
    210191         */
    211192        public function test_load_textdomain_loads_existing_translation_mo_files() {
     
    237218        /**
    238219         * @covers ::load_textdomain
    239          *
    240          * @return void
    241220         */
    242221        public function test_load_textdomain_loads_existing_translation_php_files() {
     
    269248         * @covers WP_Translation_Controller::get_headers
    270249         * @covers WP_Translation_Controller::normalize_header
    271          *
    272          * @return void
    273250         */
    274251        public function test_unload_textdomain() {
     
    297274        /**
    298275         * @covers ::unload_textdomain
    299          *
    300          * @return void
    301276         */
    302277        public function test_unload_textdomain_existing_override() {
     
    324299         * @covers ::unload_file
    325300         * @covers ::unload_textdomain
    326          *
    327          * @return void
    328301         */
    329302        public function test_unload_non_existent_files_and_textdomains() {
     
    339312         * @covers ::load_textdomain
    340313         * @covers ::unload_textdomain
    341          *
    342          * @return void
    343314         */
    344315        public function test_switch_to_locale_translations_stay_loaded_default_textdomain() {
     
    364335         * @covers ::unload_textdomain
    365336         * @covers ::change_locale
    366          *
    367          * @return void
    368337         */
    369338        public function test_switch_to_locale_translations_stay_loaded_custom_textdomain() {
  • trunk/tests/phpunit/tests/l10n/wpTranslations.php

    r57337 r57344  
    77 */
    88class WP_Translations_Tests extends WP_UnitTestCase {
    9         /**
    10          * @return void
    11          */
    129        public function tear_down() {
    1310                unload_textdomain( 'wp-tests-domain' );
     
    2017         * @covers ::__get
    2118         * @covers ::make_entry
    22          *
    23          * @return void
    2419         */
    2520        public function test_get_entries() {
     
    5954         * @covers ::__get
    6055         * @covers ::make_entry
    61          *
    62          * @return void
    6356         */
    6457        public function test_get_entries_plural() {
     
    10093         * @covers ::__get
    10194         * @covers ::make_entry
    102          *
    103          * @return void
    10495         */
    10596        public function test_get_entries_context() {
     
    146137        /**
    147138         * @covers ::__get
    148          *
    149          * @return void
    150139         */
    151140        public function test_get_headers() {
     
    175164        /**
    176165         * @covers ::__get
    177          *
    178          * @return void
    179166         */
    180167        public function test_getter_unsupported_property() {
     
    192179        /**
    193180         * @covers ::translate
    194          *
    195          * @return void
    196181         */
    197182        public function test_translate() {
     
    215200        /**
    216201         * @covers ::translate_plural
    217          *
    218          * @return void
    219202         */
    220203        public function test_translate_plural() {
     
    240223        /**
    241224         * @covers ::translate_plural
    242          *
    243          * @return void
    244225         */
    245226        public function test_translate_plural_missing() {
     
    266247         *
    267248         * @ticket 41257
    268          *
    269          * @return void
    270249         */
    271250        public function test_translate_invalid_edge_cases() {
  • trunk/tests/phpunit/tests/l10n/wpTranslationsConvert.php

    r57339 r57344  
    99        /**
    1010         * @covers ::instance
    11          *
    12          * @return void
    1311         */
    1412        public function test_get_instance() {
     
    1917        }
    2018
    21         /**
    22          * @return void
    23          */
    2419        public function test_no_files_loaded_returns_false() {
    2520                $instance = new WP_Translation_Controller();
     
    3025        /**
    3126         * @covers ::unload_textdomain
    32          *
    33          * @return void
    3427         */
    3528        public function test_unload_not_loaded() {
     
    4639         * @covers ::locate_translation
    4740         * @covers ::get_files
    48          *
    49          * @return void
    5041         */
    5142        public function test_unload_entire_textdomain() {
     
    6556         * @covers ::unload_file
    6657         * @covers WP_Translation_File::get_file
    67          *
    68          * @return void
    6958         */
    7059        public function test_unload_file_is_not_actually_loaded() {
     
    8069         * @covers ::unload_textdomain
    8170         * @covers ::is_textdomain_loaded
    82          *
    83          * @return void
    8471         */
    8572        public function test_unload_specific_locale() {
     
    11299         * @param string $file_contents
    113100         * @param string|bool $expected_error
    114          * @return void
    115          *
    116          * @phpstan-param 'mo'|'php' $type
    117101         */
    118102        public function test_invalid_files( string $type, string $file_contents, $expected_error = null ) {
     
    158142         * @covers WP_Translation_Controller::load
    159143         * @covers WP_Translation_Controller::is_textdomain_loaded
    160          *
    161          * @return void
    162144         */
    163145        public function test_load_non_existent_file() {
     
    170152        /**
    171153         * @covers WP_Translation_File::create
    172          *
    173          * @return void
    174154         */
    175155        public function test_create_non_existent_file() {
     
    179159        /**
    180160         * @covers WP_Translation_File::create
    181          *
    182          * @return void
    183161         */
    184162        public function test_create_invalid_filetype() {
     
    200178         *
    201179         * @param string $file
    202          * @return void
    203180         */
    204181        public function test_simple_translation_files( string $file ) {
     
    244221         * @covers WP_Translation_File::get_plural_form
    245222         * @covers WP_Translation_File::make_plural_form_function
    246          *
    247          * @return void
    248223         */
    249224        public function test_load_multiple_files() {
     
    294269         * @covers ::translate
    295270         * @covers ::translate_plural
    296          *
    297          * @return void
    298271         */
    299272        public function test_load_multiple_locales() {
     
    335308        /**
    336309         * @covers ::unload_textdomain
    337          *
    338          * @return void
    339310         */
    340311        public function test_unload_with_multiple_locales() {
     
    372343         * @covers ::load
    373344         * @covers ::locate_translation
    374          *
    375          * @return void
    376345         */
    377346        public function test_load_with_default_textdomain() {
     
    385354        /**
    386355         * @covers ::load
    387          *
    388          * @return void
    389356         */
    390357        public function test_load_same_file_twice() {
     
    398365        /**
    399366         * @covers ::load
    400          *
    401          * @return void
    402367         */
    403368        public function test_load_file_is_already_loaded_for_different_textdomain() {
     
    419384         * @covers WP_Translation_File::get_plural_form
    420385         * @covers WP_Translation_File::make_plural_form_function
    421          *
    422          * @return void
    423386         */
    424387        public function test_load_no_plurals() {
     
    440403        /**
    441404         * @covers ::get_headers
    442          *
    443          * @return void
    444405         */
    445406        public function test_get_headers_no_loaded_translations() {
     
    451412        /**
    452413         * @covers ::get_headers
    453          *
    454          * @return void
    455414         */
    456415        public function test_get_headers_with_default_textdomain() {
     
    468427        /**
    469428         * @covers ::get_headers
    470          *
    471          * @return void
    472429         */
    473430        public function test_get_headers_no_loaded_translations_for_domain() {
     
    481438        /**
    482439         * @covers ::get_entries
    483          *
    484          * @return void
    485440         */
    486441        public function test_get_entries_no_loaded_translations() {
     
    492447        /**
    493448         * @covers ::get_entries
    494          *
    495          * @return void
    496449         */
    497450        public function test_get_entries_with_default_textdomain() {
     
    510463        /**
    511464         * @covers ::get_entries
    512          *
    513          * @return void
    514465         */
    515466        public function test_get_entries_no_loaded_translations_for_domain() {
     
    525476         * @param string $source_file
    526477         * @param string $destination_format
    527          * @return void
    528          *
    529          * @phpstan-param 'mo'|'php' $destination_format
    530478         */
    531479        public function test_convert_format( string $source_file, string $destination_format ) {
     
    587535        /**
    588536         * @covers WP_Translation_File::transform
    589          *
    590          * @return void
    591537         */
    592538        public function test_convert_format_invalid_source() {
Note: See TracChangeset for help on using the changeset viewer.