i18n_strings_batch()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 2
1
<?php
2
3
if (! function_exists('i18n_strings_batch')) {
4
    /**
5
     * Get translations batch.
6
     *
7
     * @param string|array $keys
8
     * @param string|null  $locale
9
     *
10
     * @return array
11
     */
12
    function i18n_strings_batch(string|array $keys, ?string $locale = null): array
13
    {
14
        return \I18nStringsBatch\Facades\I18nStringsBatch::setLocale($locale)->getBatch($keys);
0 ignored issues
show
Bug introduced by
The method setLocale() does not exist on I18nStringsBatch\Facades\I18nStringsBatch. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

14
        return \I18nStringsBatch\Facades\I18nStringsBatch::/** @scrutinizer ignore-call */ setLocale($locale)->getBatch($keys);
Loading history...
15
16
    }
17
}
18
19
if (! function_exists('i18n_strings_batch_json')) {
20
    /**
21
     * Get translations batch encoded in json.
22
     *
23
     * @param string|array $keys
24
     * @param string|null  $locale
25
     * @return string
26
     */
27
    function i18n_strings_batch_json(string|array $keys, ?string $locale = null): string
28
    {
29
        return \I18nStringsBatch\Facades\I18nStringsBatch::setLocale($locale)->getBatchJson($keys);
30
    }
31
}
32