Skip to content

Commit

Permalink
Applied phpcbf
Browse files Browse the repository at this point in the history
  • Loading branch information
fadrian06 committed Feb 18, 2024
1 parent d9e5185 commit 4d064cb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
24 changes: 12 additions & 12 deletions flight/Engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,17 +362,16 @@ public function path(string $dir): void
}

/**
* 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;

Expand All @@ -382,7 +381,9 @@ protected function processMiddleware(array $middleware, array $params, string $e
? $middleware
: (method_exists($middleware, 'before') === true
? [$middleware, 'before']
: false));
: false
)
);
} elseif ($event_name === 'after') {
// must be an object. No functions allowed here
if (
Expand Down Expand Up @@ -418,11 +419,9 @@ protected function processMiddleware(array $middleware, array $params, string $e
return $at_least_one_middleware_failed;
}

/*********************************
*
* Extensible Methods
*********************************/

////////////////////////
// Extensible Methods //
////////////////////////
/**
* Starts the framework.
*
Expand Down Expand Up @@ -454,6 +453,7 @@ public function _start(): void

// Route the request
$failed_middleware_check = false;

while ($route = $router->route($request)) {
$params = array_values($route->params);

Expand Down
2 changes: 1 addition & 1 deletion flight/database/PdoWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,6 @@ protected function processInStatementSql(string $sql, array $params = []): array
$current_index += strlen($question_marks) + 4;
}

return [ 'sql' => $sql, 'params' => $params ];
return ['sql' => $sql, 'params' => $params];
}
}
1 change: 1 addition & 0 deletions flight/util/ReturnTypeWillChange.php
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 4d064cb

Please sign in to comment.