@@ -111,17 +111,17 @@ public function read(array $domains, array $locales): TranslatorBag
111
111
112
112
$ localeLanguageMap = [];
113
113
foreach ($ this ->listLanguages ($ locales ) as $ language ) {
114
- if (in_array ($ language ['data ' ]['locale ' ], $ locales )) {
114
+ if (\ in_array ($ language ['data ' ]['locale ' ], $ locales )) {
115
115
$ localeLanguageMap [$ language ['data ' ]['locale ' ]] = $ language ['data ' ]['id ' ];
116
- } elseif (in_array ($ language ['data ' ]['id ' ], $ locales )) {
116
+ } elseif (\ in_array ($ language ['data ' ]['id ' ], $ locales )) {
117
117
// try fallback to language id
118
118
$ localeLanguageMap [$ language ['data ' ]['id ' ]] = $ language ['data ' ]['id ' ];
119
119
}
120
120
}
121
121
122
- if (count ($ localeLanguageMap ) !== count ($ locales )) {
122
+ if (\ count ($ localeLanguageMap ) !== \ count ($ locales )) {
123
123
$ message = sprintf (
124
- " Unable to find all requested locales in Crowdin: \ "%s \ " not found. " ,
124
+ ' Unable to find all requested locales in Crowdin: "%s" not found. ' ,
125
125
implode (', ' , array_diff ($ locales , array_keys ($ localeLanguageMap )))
126
126
);
127
127
$ this ->logger ->error ($ message );
@@ -358,12 +358,12 @@ private function listLanguages(): array
358
358
// cannot query by locales, we need to fetch all and filter out the relevant ones
359
359
$ response = $ this ->client ->request ('GET ' , '../../languages ' , [
360
360
'query ' => [
361
- 'limit ' => 500
362
- ]
361
+ 'limit ' => 500 ,
362
+ ],
363
363
]);
364
364
365
365
if (200 !== $ response ->getStatusCode ()) {
366
- throw new ProviderException (sprintf ( 'Unable to list set languages. ' ) , $ response );
366
+ throw new ProviderException ('Unable to list set languages. ' , $ response );
367
367
}
368
368
369
369
return $ response ->toArray ()['data ' ];
0 commit comments