mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Fix linting
This commit is contained in:
parent
aa491d9294
commit
388baa01b4
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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"
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user