Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
file
  • Loading branch information
juancristobalgd1 authored Mar 19, 2024
1 parent e4573b7 commit 0b2f595
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ public function registerMiddleware(BaseMiddleware $middleware): void

/**
* Get the registered middlewares.
* @return Middlewares\BaseMiddleware[]
*/
public function getMiddlewares(): array
{
Expand All @@ -188,15 +187,15 @@ public function accessControl(array $actions, bool $allowedAction = false)
}

/**
*
* Response Instance
*/
public function response(): ?Response
{
return $this->response;
}

/**
*
* Request Instance
*/
public function request(): ?Request
{
Expand Down
2 changes: 0 additions & 2 deletions src/libraries/Middlewares/AuthMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ public function __construct(array $actions = [], bool $allowedAction = self::NOT

/**
* Execute the action, checking authentication and permissions.
*
* @return bool True if the action was executed successfully, false otherwise.
* @throws RuntimeException If the user does not have sufficient permissions.
*/
public function execute()
Expand Down
3 changes: 2 additions & 1 deletion src/libraries/Middlewares/RateLimiterMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function __construct(int $maxRequestsPerSecond, int $burstRequestsPerRequ
$this->lastRequestTime = microtime(true);
$this->burstRequestsPerRequest = $burstRequestsPerRequest;

$this->rateLimiterFiber = new Fiber(function () {
$this->rateLimiterFiber = new Fiber(function() {
while (true) {
$currentTime = microtime(true);
$timeSinceLastRequest = $currentTime - $this->lastRequestTime;
Expand Down Expand Up @@ -106,3 +106,4 @@ public function execute()
new self(10);
}
}

0 comments on commit 0b2f595

Please sign in to comment.