fix: [deprecation] toList() queries updated

cli-modification-summary
iglocska 2022-08-17 13:49:11 +02:00
parent 6bd9d7d2f0
commit 60d8a8f655
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
2 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@ class FloodProtectionComponent extends Component
public function check(string $action, int $limit = 5, int $expiration_time = 300): bool
{
$results = $this->FloodProtections->find('all')->where(['request_action' => $action, 'remote_ip' => $this->remote_ip, 'expiration' > time()])->toList();
$results = $this->FloodProtections->find()->where(['request_action' => $action, 'remote_ip' => $this->remote_ip, 'expiration' > time()])->all()->toList();
if (count($results) >= $limit) {
throw new TooManyRequestsException(__('Too many {0} requests have been issued ({1} requests allowed ever {2} seconds)', [$action, $limit, $expiration_time]));
}

View File

@ -47,7 +47,7 @@ class AppTable extends Table
->limit($options['limit'])
->page(1)
->enableHydration(false);
$topUsage = $queryTopUsage->toList();
$topUsage = $queryTopUsage->all()->toList();
$stats[$scope] = $topUsage;
if (
!empty($options['includeOthers']) && !empty($topUsage) &&