phpmyadmin / motranslator

@@ -25,12 +25,13 @@
Loading
25 25
26 26
namespace PhpMyAdmin\MoTranslator;
27 27
28 -
use const PHP_INT_MAX;
29 28
use function file_get_contents;
30 29
use function strlen;
31 30
use function substr;
32 31
use function unpack;
33 32
33 +
use const PHP_INT_MAX;
34 +
34 35
/**
35 36
 * Simple wrapper around string buffer for
36 37
 * random access and values parsing.

@@ -84,9 +84,7 @@
Loading
84 84
 */
85 85
function _gettext(string $msgid): string
86 86
{
87 -
    return Loader::getInstance()->getTranslator()->gettext(
88 -
        $msgid
89 -
    );
87 +
    return Loader::getInstance()->getTranslator()->gettext($msgid);
90 88
}
91 89
92 90
/**
@@ -98,9 +96,7 @@
Loading
98 96
 */
99 97
function __(string $msgid): string
100 98
{
101 -
    return Loader::getInstance()->getTranslator()->gettext(
102 -
        $msgid
103 -
    );
99 +
    return Loader::getInstance()->getTranslator()->gettext($msgid);
104 100
}
105 101
106 102
/**
@@ -114,11 +110,7 @@
Loading
114 110
 */
115 111
function _ngettext(string $msgid, string $msgidPlural, int $number): string
116 112
{
117 -
    return Loader::getInstance()->getTranslator()->ngettext(
118 -
        $msgid,
119 -
        $msgidPlural,
120 -
        $number
121 -
    );
113 +
    return Loader::getInstance()->getTranslator()->ngettext($msgid, $msgidPlural, $number);
122 114
}
123 115
124 116
/**
@@ -131,10 +123,7 @@
Loading
131 123
 */
132 124
function _pgettext(string $msgctxt, string $msgid): string
133 125
{
134 -
    return Loader::getInstance()->getTranslator()->pgettext(
135 -
        $msgctxt,
136 -
        $msgid
137 -
    );
126 +
    return Loader::getInstance()->getTranslator()->pgettext($msgctxt, $msgid);
138 127
}
139 128
140 129
/**
@@ -149,12 +138,7 @@
Loading
149 138
 */
150 139
function _npgettext(string $msgctxt, string $msgid, string $msgidPlural, int $number): string
151 140
{
152 -
    return Loader::getInstance()->getTranslator()->npgettext(
153 -
        $msgctxt,
154 -
        $msgid,
155 -
        $msgidPlural,
156 -
        $number
157 -
    );
141 +
    return Loader::getInstance()->getTranslator()->npgettext($msgctxt, $msgid, $msgidPlural, $number);
158 142
}
159 143
160 144
/**
@@ -167,9 +151,7 @@
Loading
167 151
 */
168 152
function _dgettext(string $domain, string $msgid): string
169 153
{
170 -
    return Loader::getInstance()->getTranslator($domain)->gettext(
171 -
        $msgid
172 -
    );
154 +
    return Loader::getInstance()->getTranslator($domain)->gettext($msgid);
173 155
}
174 156
175 157
/**
@@ -184,11 +166,7 @@
Loading
184 166
 */
185 167
function _dngettext(string $domain, string $msgid, string $msgidPlural, int $number): string
186 168
{
187 -
    return Loader::getInstance()->getTranslator($domain)->ngettext(
188 -
        $msgid,
189 -
        $msgidPlural,
190 -
        $number
191 -
    );
169 +
    return Loader::getInstance()->getTranslator($domain)->ngettext($msgid, $msgidPlural, $number);
192 170
}
193 171
194 172
/**
@@ -202,10 +180,7 @@
Loading
202 180
 */
203 181
function _dpgettext(string $domain, string $msgctxt, string $msgid): string
204 182
{
205 -
    return Loader::getInstance()->getTranslator($domain)->pgettext(
206 -
        $msgctxt,
207 -
        $msgid
208 -
    );
183 +
    return Loader::getInstance()->getTranslator($domain)->pgettext($msgctxt, $msgid);
209 184
}
210 185
211 186
/**
@@ -221,10 +196,5 @@
Loading
221 196
 */
222 197
function _dnpgettext(string $domain, string $msgctxt, string $msgid, string $msgidPlural, int $number): string
223 198
{
224 -
    return Loader::getInstance()->getTranslator($domain)->npgettext(
225 -
        $msgctxt,
226 -
        $msgid,
227 -
        $msgidPlural,
228 -
        $number
229 -
    );
199 +
    return Loader::getInstance()->getTranslator($domain)->npgettext($msgctxt, $msgid, $msgidPlural, $number);
230 200
}

@@ -28,6 +28,7 @@
Loading
28 28
29 29
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
30 30
use Throwable;
31 +
31 32
use function array_key_exists;
32 33
use function chr;
33 34
use function count;
@@ -360,6 +361,7 @@
Loading
360 361
            // But according to the php manual it should never happen
361 362
            return '';
362 363
        }
364 +
363 365
        // @codeCoverageIgnoreEnd
364 366
365 367
        if (! isset($list[$select])) {

@@ -107,14 +107,16 @@
Loading
107 107
        $localeNames = [];
108 108
109 109
        if ($locale) {
110 -
            if (preg_match(
111 -
                '/^(?P<lang>[a-z]{2,3})'      // language code
112 -
                . '(?:_(?P<country>[A-Z]{2}))?'           // country code
113 -
                . '(?:\\.(?P<charset>[-A-Za-z0-9_]+))?'   // charset
114 -
                . '(?:@(?P<modifier>[-A-Za-z0-9_]+))?$/', // @ modifier
115 -
                $locale,
116 -
                $matches
117 -
            )) {
110 +
            if (
111 +
                preg_match(
112 +
                    '/^(?P<lang>[a-z]{2,3})' // language code
113 +
                    . '(?:_(?P<country>[A-Z]{2}))?' // country code
114 +
                    . '(?:\\.(?P<charset>[-A-Za-z0-9_]+))?' // charset
115 +
                    . '(?:@(?P<modifier>[-A-Za-z0-9_]+))?$/', // @ modifier
116 +
                    $locale,
117 +
                    $matches
118 +
                )
119 +
            ) {
118 120
                $lang = $matches['lang'] ?? null;
119 121
                $country = $matches['country'] ?? null;
120 122
                $charset = $matches['charset'] ?? null;
Files Complexity Coverage
src 79 99.18%
Project Totals (4 files) 79 99.18%
phpunit-7.4-ubuntu-latest
Build #764947130 -
unit-7.4-ubuntu-latest
phpunit-8.0-ubuntu-latest
Build #764947130 -
unit-8.0-ubuntu-latest
phpunit-7.3-ubuntu-latest
Build #764947130 -
unit-7.3-ubuntu-latest
phpunit-7.2-ubuntu-latest
Build #764947130 -
unit-7.2-ubuntu-latest
phpunit-7.1-ubuntu-latest
Build #764947130 -
unit-7.1-ubuntu-latest

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading