Skip to content

Commit 6451e8a

Browse files
committed
remove limit from arguments
1 parent ed2ba84 commit 6451e8a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Symfony/Component/Translation/Bridge/Lokalise/LokaliseProvider.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
*/
3333
final class LokaliseProvider implements ProviderInterface
3434
{
35+
private const LOKALISE_GET_KEYS_LIMIT = 5000;
36+
3537
private $client;
3638
private $loader;
3739
private $logger;
@@ -259,13 +261,13 @@ private function updateTranslations(array $keysByDomain, TranslatorBagInterface
259261
}
260262
}
261263

262-
private function getKeysIds(array $keys, string $domain, int $page = 1, int $limit = 5000): array
264+
private function getKeysIds(array $keys, string $domain, int $page = 1): array
263265
{
264266
$response = $this->client->request('GET', 'keys', [
265267
'query' => [
266268
'filter_keys' => implode(',', $keys),
267269
'filter_filenames' => $this->getLokaliseFilenameFromDomain($domain),
268-
'limit' => $limit,
270+
'limit' => self::LOKALISE_GET_KEYS_LIMIT,
269271
'page' => $page,
270272
],
271273
]);
@@ -292,9 +294,9 @@ private function getKeysIds(array $keys, string $domain, int $page = 1, int $lim
292294
return $result;
293295
}
294296

295-
$pages = ceil($keysTotalCount / $limit);
297+
$pages = ceil($keysTotalCount / self::LOKALISE_GET_KEYS_LIMIT);
296298
if ($page < $pages) {
297-
$result = array_merge($result, $this->getKeysIds($keys, $domain, ++$page, $limit));
299+
$result = array_merge($result, $this->getKeysIds($keys, $domain, ++$page));
298300
}
299301

300302
return $result;

0 commit comments

Comments
 (0)