mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
techdebt(Middleware): Add more specific array types so its clickable in IDEs
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
bcc1d57a03
commit
ce583cb67b
1 changed files with 6 additions and 6 deletions
|
|
@ -40,15 +40,15 @@ use OCP\AppFramework\Middleware;
|
|||
*/
|
||||
class MiddlewareDispatcher {
|
||||
/**
|
||||
* @var array array containing all the middlewares
|
||||
* @var Middleware[] array containing all the middlewares
|
||||
*/
|
||||
private $middlewares;
|
||||
private array $middlewares;
|
||||
|
||||
/**
|
||||
* @var int counter which tells us what middleware was executed once an
|
||||
* exception occurs
|
||||
*/
|
||||
private $middlewareCounter;
|
||||
private int $middlewareCounter;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -64,14 +64,14 @@ class MiddlewareDispatcher {
|
|||
* Adds a new middleware
|
||||
* @param Middleware $middleWare the middleware which will be added
|
||||
*/
|
||||
public function registerMiddleware(Middleware $middleWare) {
|
||||
public function registerMiddleware(Middleware $middleWare): void {
|
||||
$this->middlewares[] = $middleWare;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* returns an array with all middleware elements
|
||||
* @return array the middlewares
|
||||
* @return Middleware[] the middlewares
|
||||
*/
|
||||
public function getMiddlewares(): array {
|
||||
return $this->middlewares;
|
||||
|
|
@ -86,7 +86,7 @@ class MiddlewareDispatcher {
|
|||
* @param string $methodName the name of the method that will be called on
|
||||
* the controller
|
||||
*/
|
||||
public function beforeController(Controller $controller, string $methodName) {
|
||||
public function beforeController(Controller $controller, string $methodName): void {
|
||||
// we need to count so that we know which middlewares we have to ask in
|
||||
// case there is an exception
|
||||
$middlewareCount = \count($this->middlewares);
|
||||
|
|
|
|||
Loading…
Reference in a new issue