Fix linting

This commit is contained in:
Aaron Carlino 2019-03-20 13:08:56 +13:00
parent aa491d9294
commit 388baa01b4
3 changed files with 6 additions and 16 deletions

View File

@ -365,13 +365,12 @@ class Director implements TemplateGlobalProvider
};
break;
}
$start = time();
// Call the handler with the configured middlewares
$response = $this->callMiddleware($request, $handler);
$end = time();
// Note that if a different request was previously registered, this will now be lost
// In these cases it's better to use Kernel::nest() prior to kicking off a nested request
$elapsed = $end - $start;
Injector::inst()->unregisterNamedObject(HTTPRequest::class);
return $response;

View File

@ -54,21 +54,12 @@ trait HTTPMiddlewareAware
*/
protected function callMiddleware(HTTPRequest $request, callable $last)
{
$classes = array_map(function ($middle) {
return get_class($middle);
}, $this->getMiddlewares());
// Reverse middlewares
$next = $last;
/** @var HTTPMiddleware $middleware */
foreach (array_reverse($this->getMiddlewares()) as $middleware) {
$next = function ($request) use ($middleware, $next) {
$start = time();
$value = $middleware->process($request, $next);
$end = time();
$elapsed = $end - $start;
return $value;
return $middleware->process($request, $next);
};
}
return $next($request);

View File

@ -58,9 +58,9 @@ class CmsUiContext implements Context
$timeoutMs = $this->getMainContext()->getAjaxTimeout();
$this->getSession()->wait(
$timeoutMs,
"(".
"document.getElementsByClassName('cms-content-loading-overlay').length +".
"document.getElementsByClassName('cms-loading-container').length".
"(" .
"document.getElementsByClassName('cms-content-loading-overlay').length +" .
"document.getElementsByClassName('cms-loading-container').length" .
") == 0"
);
}