Skip to content

Commit

Permalink
Merge pull request #37 from Kanti/bugfix/middleware.in.total-multiple…
Browse files Browse the repository at this point in the history
…-times
  • Loading branch information
Kanti authored Sep 14, 2023
2 parents cb9d888 + 3125063 commit 6a464ee
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Classes/Middleware/WrapMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface
self::$middlewareIn = TimingUtility::stopWatch($this->isKernel ? 'requestHandler' : 'middleware.in', $this->info);

if ($this->isKernel) {
TimingUtility::end('middleware.in.total');
$request->getAttribute('middleware.in.total')?->stop();
}

$response = $this->requestHandler->handle($request);
Expand Down
2 changes: 1 addition & 1 deletion Classes/Middleware/XClassMiddlewareDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface
$stop = TimingUtility::stopWatch('bootstrap');
$stop->startTime = $_SERVER["REQUEST_TIME_FLOAT"];
$stop->stop();
TimingUtility::start('middleware.in.total');
$request = $request->withAttribute('middleware.in.total', TimingUtility::stopWatch('middleware.in.total'));
if ($this->tip instanceof WrapMiddleware) {
$this->tip->isFirst();
}
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ parameters:
reportUnmatchedIgnoredErrors: false
typo3:
requestGetAttributeMapping:
server-timing:middleware:inward: Kanti\ServerTiming\Dto\StopWatch|null
middleware.in.total: Kanti\ServerTiming\Dto\StopWatch|null

0 comments on commit 6a464ee

Please sign in to comment.