Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6451e8a

Browse filesBrowse files
committed
remove limit from arguments
1 parent ed2ba84 commit 6451e8a
Copy full SHA for 6451e8a

File tree

1 file changed

+6
-4
lines changed
Filter options

1 file changed

+6
-4
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Translation/Bridge/Lokalise/LokaliseProvider.php
+6-4Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.