Fixed phpcs format problems in the rest of Flight modules

pull/531/head
fadrian06 1 year ago
parent def0e65965
commit 44a056ca30

@ -1,7 +1,5 @@
<?php
declare(strict_types=1);
/**
* Flight: An extensible micro-framework.
*
@ -9,6 +7,8 @@ declare(strict_types=1);
* @license MIT, http://flightphp.com/license
*/
declare(strict_types=1);
use flight\core\Dispatcher;
use flight\Engine;
use flight\net\Request;
@ -150,7 +150,6 @@ class Flight
* Set the engine instance
*
* @param Engine $engine Vroom vroom!
* @return void
*/
public static function setEngine(Engine $engine): void
{

@ -1,7 +1,5 @@
<?php
declare(strict_types=1);
/**
* Flight: An extensible micro-framework.
*
@ -9,6 +7,8 @@ declare(strict_types=1);
* @license MIT, http://flightphp.com/license
*/
declare(strict_types=1);
use flight\core\Loader;
require_once __DIR__ . '/core/Loader.php';

@ -1,7 +1,5 @@
<?php
declare(strict_types=1);
/**
* Flight: An extensible micro-framework.
*
@ -9,6 +7,8 @@ declare(strict_types=1);
* @license MIT, http://flightphp.com/license
*/
declare(strict_types=1);
namespace flight\core;
use Exception;

@ -1,7 +1,5 @@
<?php
declare(strict_types=1);
/**
* Flight: An extensible micro-framework.
*
@ -9,6 +7,8 @@ declare(strict_types=1);
* @license MIT, http://flightphp.com/license
*/
declare(strict_types=1);
namespace flight\core;
use Closure;

@ -111,10 +111,11 @@ class PdoWrapper extends PDO
*/
protected function processInStatementSql(string $sql, array $params = []): array
{
// Handle "IN(?)". This is to be used with a comma delimited string, but can also be used with an array.
// Remove the spaces in variations of "IN ( ? )" where the space after IN is optional, and any number of spaces before and after the question mark is optional.
// Then loop through each "IN(?)" in the query and replace the single question mark with the correct number of question marks.
/* Handle "IN(?)". This is to be used with a comma delimited string, but can also be used with an array.
Remove the spaces in variations of "IN ( ? )" where the space after IN is optional, and any number of
spaces before and after the question mark is optional.
Then loop through each "IN(?)" in the query and replace the single question mark with the correct
number of question marks. */
$sql = preg_replace('/IN\s*\(\s*\?\s*\)/i', 'IN(?)', $sql);
$current_index = 0;
while (($current_index = strpos($sql, 'IN(?)', $current_index)) !== false) {

@ -1,7 +1,5 @@
<?php
declare(strict_types=1);
/**
* Flight: An extensible micro-framework.
*
@ -9,6 +7,8 @@ declare(strict_types=1);
* @license MIT, http://flightphp.com/license
*/
declare(strict_types=1);
namespace flight\net;
use flight\util\Collection;

@ -1,7 +1,5 @@
<?php
declare(strict_types=1);
/**
* Flight: An extensible micro-framework.
*
@ -9,6 +7,8 @@ declare(strict_types=1);
* @license MIT, http://flightphp.com/license
*/
declare(strict_types=1);
namespace flight\net;
use Exception;
@ -288,7 +288,10 @@ class Response
* Sets a real header. Mostly used for test mocking.
*
* @param string $header_string The header string you would pass to header()
* @param bool $replace The optional replace parameter indicates whether the header should replace a previous similar header, or add a second header of the same type. By default it will replace, but if you pass in false as the second argument you can force multiple headers of the same type.
* @param bool $replace The optional replace parameter indicates whether the
* header should replace a previous similar header, or add a second header of
* the same type. By default it will replace, but if you pass in false as the
* second argument you can force multiple headers of the same type.
* @param int $response_code The response code to send
* @return $this
* @codeCoverageIgnore

@ -1,7 +1,5 @@
<?php
declare(strict_types=1);
/**
* Flight: An extensible micro-framework.
*
@ -9,6 +7,8 @@ declare(strict_types=1);
* @license MIT, http://flightphp.com/license
*/
declare(strict_types=1);
namespace flight\net;
/**
@ -132,11 +132,9 @@ class Route
$regex
);
// Fix trailing slash
if ('/' === $last_char) {
if ('/' === $last_char) { // Fix trailing slash
$regex .= '?';
} // Allow trailing slash
else {
} else { // Allow trailing slash
$regex .= '/?';
}

@ -1,7 +1,5 @@
<?php
declare(strict_types=1);
/**
* Flight: An extensible micro-framework.
*
@ -9,6 +7,8 @@ declare(strict_types=1);
* @license MIT, http://flightphp.com/license
*/
declare(strict_types=1);
namespace flight\net;
use Exception;
@ -166,7 +166,8 @@ class Router
*
* @param string $group_prefix group URL prefix (such as /api/v1)
* @param callable $callback The necessary calling that holds the Router class
* @param array<int,callable|object> $group_middlewares The middlewares to be applied to the group Ex: [ $middleware1, $middleware2 ]
* @param array<int, callable|object> $group_middlewares The middlewares to be
* applied to the group Ex: [ $middleware1, $middleware2 ]
*/
public function group(string $group_prefix, callable $callback, array $group_middlewares = []): void
{

@ -1,7 +1,5 @@
<?php
declare(strict_types=1);
/**
* Flight: An extensible micro-framework.
*
@ -9,6 +7,8 @@ declare(strict_types=1);
* @license MIT, http://flightphp.com/license
*/
declare(strict_types=1);
namespace flight\template;
/**

@ -1,7 +1,5 @@
<?php
declare(strict_types=1);
/**
* Flight: An extensible micro-framework.
*
@ -9,6 +7,8 @@ declare(strict_types=1);
* @license MIT, http://flightphp.com/license
*/
declare(strict_types=1);
namespace flight\util;
use ArrayAccess;

Loading…
Cancel
Save