nextcloud/lib/public/AppFramework/Http/Attribute/ARateLimit.php
Andy Scherzinger dae7c159f7
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-24 13:11:22 +02:00

41 lines
692 B
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\AppFramework\Http\Attribute;
/**
* Attribute for controller methods that want to limit the times a logged-in
* user can call the endpoint in a given time period.
*
* @since 27.0.0
*/
abstract class ARateLimit {
/**
* @since 27.0.0
*/
public function __construct(
protected int $limit,
protected int $period,
) {
}
/**
* @since 27.0.0
*/
public function getLimit(): int {
return $this->limit;
}
/**
* @since 27.0.0
*/
public function getPeriod(): int {
return $this->period;
}
}