Skip to content

Commit 4309f55

Browse files
committed
Apply to parameters
1 parent 708fb6d commit 4309f55

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+95
-87
lines changed

.php-cs-fixer.dist.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,15 @@
3939
__DIR__ . '/spark',
4040
]);
4141

42-
$overrides = [];
42+
$overrides = [
43+
'trailing_comma_in_multiline' => [
44+
'after_heredoc' => true,
45+
'elements' => [
46+
'arrays',
47+
'parameters',
48+
],
49+
],
50+
];
4351

4452
$options = [
4553
'cacheFile' => 'build/.php-cs-fixer.cache',

system/CLI/GeneratorTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ protected function parseTemplate(
370370
string $class,
371371
array $search = [],
372372
array $replace = [],
373-
array $data = []
373+
array $data = [],
374374
): string {
375375
// Retrieves the namespace part from the fully qualified class name.
376376
$namespace = trim(

system/Commands/Database/ShowTableInfo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ private function makeTableRows(
272272
string $tableName,
273273
int $limitRows,
274274
int $limitFieldValue,
275-
?string $sortField = null
275+
?string $sortField = null,
276276
): array {
277277
$this->tbody = [];
278278

system/Commands/Utilities/Routes/AutoRouterImproved/AutoRouteCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct(
3636
private readonly string $defaultMethod,
3737
private readonly array $httpMethods,
3838
private readonly array $protectedControllers,
39-
private readonly string $prefix = ''
39+
private readonly string $prefix = '',
4040
) {
4141
}
4242

system/Commands/Utilities/Routes/AutoRouterImproved/ControllerMethodReader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ final class ControllerMethodReader
3333
*/
3434
public function __construct(
3535
private readonly string $namespace,
36-
private readonly array $httpMethods
36+
private readonly array $httpMethods,
3737
) {
3838
$config = config(Routing::class);
3939
$this->translateURIDashes = $config->translateURIDashes;
@@ -214,7 +214,7 @@ private function getRouteForDefaultController(
214214
string $classname,
215215
string $methodName,
216216
string $httpVerb,
217-
ReflectionMethod $method
217+
ReflectionMethod $method,
218218
): array {
219219
$output = [];
220220

system/Commands/Utilities/Routes/ControllerFinder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ final class ControllerFinder
2828
* @param string $namespace namespace to search
2929
*/
3030
public function __construct(
31-
private readonly string $namespace
31+
private readonly string $namespace,
3232
) {
3333
$this->locator = service('locator');
3434
}

system/Commands/Utilities/Routes/ControllerMethodReader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ private function getRouteWithoutController(
153153
string $defaultController,
154154
string $uriByClass,
155155
string $classname,
156-
string $methodName
156+
string $methodName,
157157
): array {
158158
if ($classShortname !== $defaultController) {
159159
return [];

system/Commands/Utilities/Routes/FilterCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct(
3232
*
3333
* If set to true, route filters are not found.
3434
*/
35-
private readonly bool $resetRoutes = false
35+
private readonly bool $resetRoutes = false,
3636
) {
3737
}
3838

system/Common.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ function esc($data, string $context = 'html', ?string $encoding = null)
470470
function force_https(
471471
int $duration = 31_536_000,
472472
?RequestInterface $request = null,
473-
?ResponseInterface $response = null
473+
?ResponseInterface $response = null,
474474
): void {
475475
$request ??= service('request');
476476

system/Config/Services.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ public static function encrypter(?EncryptionConfig $config = null, $getShared =
267267
*/
268268
public static function exceptions(
269269
?ExceptionsConfig $config = null,
270-
bool $getShared = true
270+
bool $getShared = true,
271271
) {
272272
if ($getShared) {
273273
return static::getSharedInstance('exceptions', $config);
@@ -721,7 +721,7 @@ public static function session(?SessionConfig $config = null, bool $getShared =
721721
public static function siteurifactory(
722722
?App $config = null,
723723
?Superglobals $superglobals = null,
724-
bool $getShared = true
724+
bool $getShared = true,
725725
) {
726726
if ($getShared) {
727727
return static::getSharedInstance('siteurifactory', $config, $superglobals);
@@ -741,7 +741,7 @@ public static function siteurifactory(
741741
public static function superglobals(
742742
?array $server = null,
743743
?array $get = null,
744-
bool $getShared = true
744+
bool $getShared = true,
745745
) {
746746
if ($getShared) {
747747
return static::getSharedInstance('superglobals', $server, $get);

system/DataCaster/Cast/ArrayCast.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class ArrayCast extends BaseCast implements CastInterface
2424
public static function get(
2525
mixed $value,
2626
array $params = [],
27-
?object $helper = null
27+
?object $helper = null,
2828
): array {
2929
if (! is_string($value)) {
3030
self::invalidTypeValueError($value);
@@ -40,7 +40,7 @@ public static function get(
4040
public static function set(
4141
mixed $value,
4242
array $params = [],
43-
?object $helper = null
43+
?object $helper = null,
4444
): string {
4545
return serialize($value);
4646
}

system/DataCaster/Cast/BaseCast.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ abstract class BaseCast implements CastInterface
2020
public static function get(
2121
mixed $value,
2222
array $params = [],
23-
?object $helper = null
23+
?object $helper = null,
2424
): mixed {
2525
return $value;
2626
}
2727

2828
public static function set(
2929
mixed $value,
3030
array $params = [],
31-
?object $helper = null
31+
?object $helper = null,
3232
): mixed {
3333
return $value;
3434
}

system/DataCaster/Cast/BooleanCast.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class BooleanCast extends BaseCast
2424
public static function get(
2525
mixed $value,
2626
array $params = [],
27-
?object $helper = null
27+
?object $helper = null,
2828
): bool {
2929
// For PostgreSQL
3030
if ($value === 't') {

system/DataCaster/Cast/CSVCast.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class CSVCast extends BaseCast
2424
public static function get(
2525
mixed $value,
2626
array $params = [],
27-
?object $helper = null
27+
?object $helper = null,
2828
): array {
2929
if (! is_string($value)) {
3030
self::invalidTypeValueError($value);
@@ -36,7 +36,7 @@ public static function get(
3636
public static function set(
3737
mixed $value,
3838
array $params = [],
39-
?object $helper = null
39+
?object $helper = null,
4040
): string {
4141
if (! is_array($value)) {
4242
self::invalidTypeValueError($value);

system/DataCaster/Cast/CastInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ interface CastInterface
2727
public static function get(
2828
mixed $value,
2929
array $params = [],
30-
?object $helper = null
30+
?object $helper = null,
3131
): mixed;
3232

3333
/**
@@ -42,6 +42,6 @@ public static function get(
4242
public static function set(
4343
mixed $value,
4444
array $params = [],
45-
?object $helper = null
45+
?object $helper = null,
4646
): mixed;
4747
}

system/DataCaster/Cast/DatetimeCast.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class DatetimeCast extends BaseCast
2828
public static function get(
2929
mixed $value,
3030
array $params = [],
31-
?object $helper = null
31+
?object $helper = null,
3232
): Time {
3333
if (! is_string($value)) {
3434
self::invalidTypeValueError($value);
@@ -56,7 +56,7 @@ public static function get(
5656
public static function set(
5757
mixed $value,
5858
array $params = [],
59-
?object $helper = null
59+
?object $helper = null,
6060
): string {
6161
if (! $value instanceof Time) {
6262
self::invalidTypeValueError($value);

system/DataCaster/Cast/FloatCast.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class FloatCast extends BaseCast
2424
public static function get(
2525
mixed $value,
2626
array $params = [],
27-
?object $helper = null
27+
?object $helper = null,
2828
): float {
2929
if (! is_float($value) && ! is_string($value)) {
3030
self::invalidTypeValueError($value);

system/DataCaster/Cast/IntBoolCast.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ final class IntBoolCast extends BaseCast
2424
public static function get(
2525
mixed $value,
2626
array $params = [],
27-
?object $helper = null
27+
?object $helper = null,
2828
): bool {
2929
if (! is_int($value) && ! is_string($value)) {
3030
self::invalidTypeValueError($value);
@@ -36,7 +36,7 @@ public static function get(
3636
public static function set(
3737
mixed $value,
3838
array $params = [],
39-
?object $helper = null
39+
?object $helper = null,
4040
): int {
4141
if (! is_bool($value)) {
4242
self::invalidTypeValueError($value);

system/DataCaster/Cast/IntegerCast.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class IntegerCast extends BaseCast
2424
public static function get(
2525
mixed $value,
2626
array $params = [],
27-
?object $helper = null
27+
?object $helper = null,
2828
): int {
2929
if (! is_string($value) && ! is_int($value)) {
3030
self::invalidTypeValueError($value);

system/DataCaster/Cast/JsonCast.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class JsonCast extends BaseCast
2828
public static function get(
2929
mixed $value,
3030
array $params = [],
31-
?object $helper = null
31+
?object $helper = null,
3232
): array|stdClass {
3333
if (! is_string($value)) {
3434
self::invalidTypeValueError($value);
@@ -50,7 +50,7 @@ public static function get(
5050
public static function set(
5151
mixed $value,
5252
array $params = [],
53-
?object $helper = null
53+
?object $helper = null,
5454
): string {
5555
try {
5656
$output = json_encode($value, JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR);

system/DataCaster/Cast/TimestampCast.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class TimestampCast extends BaseCast
2626
public static function get(
2727
mixed $value,
2828
array $params = [],
29-
?object $helper = null
29+
?object $helper = null,
3030
): Time {
3131
if (! is_int($value) && ! is_string($value)) {
3232
self::invalidTypeValueError($value);
@@ -38,7 +38,7 @@ public static function get(
3838
public static function set(
3939
mixed $value,
4040
array $params = [],
41-
?object $helper = null
41+
?object $helper = null,
4242
): int {
4343
if (! $value instanceof Time) {
4444
self::invalidTypeValueError($value);

system/DataCaster/Cast/URICast.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class URICast extends BaseCast
2626
public static function get(
2727
mixed $value,
2828
array $params = [],
29-
?object $helper = null
29+
?object $helper = null,
3030
): URI {
3131
if (! is_string($value)) {
3232
self::invalidTypeValueError($value);
@@ -38,7 +38,7 @@ public static function get(
3838
public static function set(
3939
mixed $value,
4040
array $params = [],
41-
?object $helper = null
41+
?object $helper = null,
4242
): string {
4343
if (! $value instanceof URI) {
4444
self::invalidTypeValueError($value);

system/DataCaster/DataCaster.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function __construct(
6868
?array $castHandlers = null,
6969
?array $types = null,
7070
private readonly ?object $helper = null,
71-
private readonly bool $strict = true
71+
private readonly bool $strict = true,
7272
) {
7373
$this->castHandlers = array_merge($this->castHandlers, $castHandlers);
7474

system/Database/Forge.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ public function addForeignKey(
425425
$tableField = '',
426426
string $onUpdate = '',
427427
string $onDelete = '',
428-
string $fkName = ''
428+
string $fkName = '',
429429
): Forge {
430430
$fieldName = (array) $fieldName;
431431
$tableField = (array) $tableField;

system/Debug/BaseExceptionHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ abstract public function handle(
6161
RequestInterface $request,
6262
ResponseInterface $response,
6363
int $statusCode,
64-
int $exitCode
64+
int $exitCode,
6565
);
6666

6767
/**

system/Debug/ExceptionHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function handle(
4747
RequestInterface $request,
4848
ResponseInterface $response,
4949
int $statusCode,
50-
int $exitCode
50+
int $exitCode,
5151
): void {
5252
// ResponseTrait needs these properties.
5353
$this->request = $request;
@@ -129,7 +129,7 @@ public function handle(
129129
protected function determineView(
130130
Throwable $exception,
131131
string $templatePath,
132-
int $statusCode = 500
132+
int $statusCode = 500,
133133
): string {
134134
// Production environments should have a custom exception file.
135135
$view = 'production.php';

system/Debug/ExceptionHandlerInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ public function handle(
2727
RequestInterface $request,
2828
ResponseInterface $response,
2929
int $statusCode,
30-
int $exitCode
30+
int $exitCode,
3131
): void;
3232
}

system/HTTP/Negotiate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ protected function getBestMatch(
154154
?string $header = null,
155155
bool $enforceTypes = false,
156156
bool $strictMatch = false,
157-
bool $matchLocales = false
157+
bool $matchLocales = false,
158158
): string {
159159
if ($supported === []) {
160160
throw HTTPException::forEmptySupportedNegotiations();

system/HTTP/OutgoingRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(
4343
?URI $uri = null,
4444
array $headers = [],
4545
$body = null,
46-
string $version = '1.1'
46+
string $version = '1.1',
4747
) {
4848
$this->method = $method;
4949
$this->uri = $uri;

system/HTTP/ResponseInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ public function setCookie(
341341
$prefix = '',
342342
$secure = false,
343343
$httponly = false,
344-
$samesite = null
344+
$samesite = null,
345345
);
346346

347347
/**

0 commit comments

Comments
 (0)