Applied phpcbf

pull/545/head
fadrian06 11 months ago
parent d9e5185087
commit 4d064cbb6d

@ -362,17 +362,16 @@ class Engine
}
/**
* Processes each routes middleware
* Processes each routes middleware.
*
* @param array<int,callable> $middleware middleware attached to the route
* @param array<mixed,mixed> $params route->params
* @param string $event_name if this is the before or after method
*
* @return boolean
* @param array<int, callable> $middleware Middleware attached to the route.
* @param array<mixed> $params `$route->params`.
* @param string $event_name If this is the before or after method.
*/
protected function processMiddleware(array $middleware, array $params, string $event_name): bool
{
$at_least_one_middleware_failed = false;
foreach ($middleware as $middleware) {
$middleware_object = false;
@ -382,7 +381,9 @@ class Engine
? $middleware
: (method_exists($middleware, 'before') === true
? [$middleware, 'before']
: false));
: false
)
);
} elseif ($event_name === 'after') {
// must be an object. No functions allowed here
if (
@ -418,11 +419,9 @@ class Engine
return $at_least_one_middleware_failed;
}
/*********************************
*
* Extensible Methods
*********************************/
////////////////////////
// Extensible Methods //
////////////////////////
/**
* Starts the framework.
*
@ -454,6 +453,7 @@ class Engine
// Route the request
$failed_middleware_check = false;
while ($route = $router->route($request)) {
$params = array_values($route->params);

@ -136,6 +136,6 @@ class PdoWrapper extends PDO
$current_index += strlen($question_marks) + 4;
}
return [ 'sql' => $sql, 'params' => $params ];
return ['sql' => $sql, 'params' => $params];
}
}

@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
// This file is only here so that the PHP8 attribute for doesn't throw an error in files

Loading…
Cancel
Save