From 4d064cbb6df16e927423a5a58592cdd6a183596d Mon Sep 17 00:00:00 2001 From: fadrian06 Date: Sun, 18 Feb 2024 03:42:25 -0400 Subject: [PATCH] Applied phpcbf --- flight/Engine.php | 24 ++++++++++++------------ flight/database/PdoWrapper.php | 2 +- flight/util/ReturnTypeWillChange.php | 1 + 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/flight/Engine.php b/flight/Engine.php index 1826445..ffd51e4 100644 --- a/flight/Engine.php +++ b/flight/Engine.php @@ -362,17 +362,16 @@ class Engine } /** - * Processes each routes middleware + * Processes each routes middleware. * - * @param array $middleware middleware attached to the route - * @param array $params route->params - * @param string $event_name if this is the before or after method - * - * @return boolean + * @param array $middleware Middleware attached to the route. + * @param array $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); diff --git a/flight/database/PdoWrapper.php b/flight/database/PdoWrapper.php index ee6d4bf..842038c 100644 --- a/flight/database/PdoWrapper.php +++ b/flight/database/PdoWrapper.php @@ -136,6 +136,6 @@ class PdoWrapper extends PDO $current_index += strlen($question_marks) + 4; } - return [ 'sql' => $sql, 'params' => $params ]; + return ['sql' => $sql, 'params' => $params]; } } diff --git a/flight/util/ReturnTypeWillChange.php b/flight/util/ReturnTypeWillChange.php index df7c49f..31a929b 100644 --- a/flight/util/ReturnTypeWillChange.php +++ b/flight/util/ReturnTypeWillChange.php @@ -1,4 +1,5 @@