WordPress.org

Make WordPress Core

Ticket #47678: 47678-functions-in-tools-i18n-not-gettext.patch

File 47678-functions-in-tools-i18n-not-gettext.patch, 1.3 KB (added by jrf, 10 months ago)

Simplify & modernize functions in tools/i18n/not-gettexted.php

  • tools/i18n/not-gettexted.php

    From 307699119af2337a30213969032ab96aa3401b51 Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Fri, 12 Jul 2019 06:12:47 +0200
    Subject: [PATCH] Simplify & modernize functions in
     tools/i18n/not-gettexted.php
    
    ---
     tools/i18n/not-gettexted.php | 9 +++------
     1 file changed, 3 insertions(+), 6 deletions(-)
    
    diff --git a/tools/i18n/not-gettexted.php b/tools/i18n/not-gettexted.php
    index e8ae2c3143..c40631b6ea 100644
    a b class NotGettexted { 
    2929        var $commands = array('extract' => 'command_extract', 'replace' => 'command_replace' );
    3030
    3131
    32         function logmsg() {
    33                 $args = func_get_args();
     32        function logmsg( ...$args ) {
    3433                if ($this->enable_logging) error_log(implode(' ', $args));
    3534        }
    3635
    class NotGettexted { 
    138137        }
    139138
    140139
    141         function command_extract() {
    142                 $args = func_get_args();
     140        function command_extract( ...$args ) {
    143141                $pot_filename = $args[0];
    144142                if (isset($args[1]) && is_array($args[1]))
    145143                        $filenames = $args[1];
    class NotGettexted { 
    176174                return true;
    177175        }
    178176
    179         function command_replace() {
    180                 $args = func_get_args();
     177        function command_replace( ...$args ) {
    181178                $mo_filename = $args[0];
    182179                if (isset($args[1]) && is_array($args[1]))
    183180                        $filenames = $args[1];