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

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

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

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

@ -111,10 +111,11 @@ class PdoWrapper extends PDO
*/ */
protected function processInStatementSql(string $sql, array $params = []): array 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.
// 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
// 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. 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. 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); $sql = preg_replace('/IN\s*\(\s*\?\s*\)/i', 'IN(?)', $sql);
$current_index = 0; $current_index = 0;
while (($current_index = strpos($sql, 'IN(?)', $current_index)) !== false) { while (($current_index = strpos($sql, 'IN(?)', $current_index)) !== false) {

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

@ -1,7 +1,5 @@
<?php <?php
declare(strict_types=1);
/** /**
* Flight: An extensible micro-framework. * Flight: An extensible micro-framework.
* *
@ -9,6 +7,8 @@ declare(strict_types=1);
* @license MIT, http://flightphp.com/license * @license MIT, http://flightphp.com/license
*/ */
declare(strict_types=1);
namespace flight\net; namespace flight\net;
use Exception; use Exception;
@ -288,7 +288,10 @@ class Response
* Sets a real header. Mostly used for test mocking. * Sets a real header. Mostly used for test mocking.
* *
* @param string $header_string The header string you would pass to header() * @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 * @param int $response_code The response code to send
* @return $this * @return $this
* @codeCoverageIgnore * @codeCoverageIgnore

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

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

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

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

Loading…
Cancel
Save