Skip to content

Commit aa90ef3

Browse files
authored
Merge branch '4.3' into BatchUpdateSQL
2 parents 6460680 + e6893f3 commit aa90ef3

File tree

102 files changed

+869
-777
lines changed

Some content is hidden

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

102 files changed

+869
-777
lines changed

.php-cs-fixer.dist.php

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use CodeIgniter\CodingStandard\CodeIgniter4;
1515
use Nexus\CsConfig\Factory;
1616
use Nexus\CsConfig\Fixer\Comment\NoCodeSeparatorCommentFixer;
17-
use Nexus\CsConfig\Fixer\Comment\SpaceAfterCommentStartFixer;
1817
use Nexus\CsConfig\FixerGenerator;
1918
use PhpCsFixer\Finder;
2019

@@ -39,15 +38,51 @@
3938
__DIR__ . '/spark',
4039
]);
4140

42-
$overrides = [];
41+
$overrides = [
42+
// <<<<<<<<<<<<<<<<<<<<<<<< @TODO TO BE REMOVED ONCE LIVE IN CODING-STANDARD
43+
'blank_line_between_import_groups' => true,
44+
'class_definition' => [
45+
'multi_line_extends_each_single_line' => true,
46+
'single_item_single_line' => true,
47+
'single_line' => true,
48+
'space_before_parenthesis' => true,
49+
'inline_constructor_arguments' => true,
50+
],
51+
'control_structure_braces' => true,
52+
'no_multiple_statements_per_line' => true,
53+
'no_trailing_comma_in_singleline' => [
54+
'elements' => [
55+
'arguments',
56+
'array_destructuring',
57+
'array',
58+
'group_import',
59+
],
60+
],
61+
'no_useless_nullsafe_operator' => true,
62+
'phpdoc_separation' => [
63+
'groups' => [
64+
['immutable', 'psalm-immutable'],
65+
['param', 'phpstan-param', 'psalm-param'],
66+
['phpstan-pure', 'psalm-pure'],
67+
['readonly', 'psalm-readonly'],
68+
['return', 'phpstan-return', 'psalm-return'],
69+
['template', 'phpstan-template', 'psalm-template'],
70+
['template-covariant', 'phpstan-template-covariant', 'psalm-template-covariant'],
71+
['phpstan-type', 'psalm-type'],
72+
['var', 'phpstan-var', 'psalm-var'],
73+
],
74+
],
75+
'single_line_comment_spacing' => true,
76+
'statement_indentation' => true,
77+
// >>>>>>>>>>>>>>>>>>>>>>>>>
78+
];
4379

4480
$options = [
4581
'cacheFile' => 'build/.php-cs-fixer.cache',
4682
'finder' => $finder,
4783
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
4884
'customRules' => [
4985
NoCodeSeparatorCommentFixer::name() => true,
50-
SpaceAfterCommentStartFixer::name() => true,
5186
],
5287
];
5388

.php-cs-fixer.no-header.php

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use CodeIgniter\CodingStandard\CodeIgniter4;
1515
use Nexus\CsConfig\Factory;
1616
use Nexus\CsConfig\Fixer\Comment\NoCodeSeparatorCommentFixer;
17-
use Nexus\CsConfig\Fixer\Comment\SpaceAfterCommentStartFixer;
1817
use Nexus\CsConfig\FixerGenerator;
1918
use PhpCsFixer\Finder;
2019

@@ -31,15 +30,51 @@
3130
__DIR__ . '/admin/starter/builds',
3231
]);
3332

34-
$overrides = [];
33+
$overrides = [
34+
// <<<<<<<<<<<<<<<<<<<<<<<< @TODO TO BE REMOVED ONCE LIVE IN CODING-STANDARD
35+
'blank_line_between_import_groups' => true,
36+
'class_definition' => [
37+
'multi_line_extends_each_single_line' => true,
38+
'single_item_single_line' => true,
39+
'single_line' => true,
40+
'space_before_parenthesis' => true,
41+
'inline_constructor_arguments' => true,
42+
],
43+
'control_structure_braces' => true,
44+
'no_multiple_statements_per_line' => true,
45+
'no_trailing_comma_in_singleline' => [
46+
'elements' => [
47+
'arguments',
48+
'array_destructuring',
49+
'array',
50+
'group_import',
51+
],
52+
],
53+
'no_useless_nullsafe_operator' => true,
54+
'phpdoc_separation' => [
55+
'groups' => [
56+
['immutable', 'psalm-immutable'],
57+
['param', 'phpstan-param', 'psalm-param'],
58+
['phpstan-pure', 'psalm-pure'],
59+
['readonly', 'psalm-readonly'],
60+
['return', 'phpstan-return', 'psalm-return'],
61+
['template', 'phpstan-template', 'psalm-template'],
62+
['template-covariant', 'phpstan-template-covariant', 'psalm-template-covariant'],
63+
['phpstan-type', 'psalm-type'],
64+
['var', 'phpstan-var', 'psalm-var'],
65+
],
66+
],
67+
'single_line_comment_spacing' => true,
68+
'statement_indentation' => true,
69+
// >>>>>>>>>>>>>>>>>>>>>>>>>
70+
];
3571

3672
$options = [
3773
'cacheFile' => 'build/.php-cs-fixer.no-header.cache',
3874
'finder' => $finder,
3975
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
4076
'customRules' => [
4177
NoCodeSeparatorCommentFixer::name() => true,
42-
SpaceAfterCommentStartFixer::name() => true,
4378
],
4479
];
4580

.php-cs-fixer.user-guide.php

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use CodeIgniter\CodingStandard\CodeIgniter4;
1515
use Nexus\CsConfig\Factory;
1616
use Nexus\CsConfig\Fixer\Comment\NoCodeSeparatorCommentFixer;
17-
use Nexus\CsConfig\Fixer\Comment\SpaceAfterCommentStartFixer;
1817
use Nexus\CsConfig\FixerGenerator;
1918
use PhpCsFixer\Finder;
2019

@@ -34,6 +33,42 @@
3433
'php_unit_internal_class' => false,
3534
'no_unused_imports' => false,
3635
'class_attributes_separation' => false,
36+
// <<<<<<<<<<<<<<<<<<<<<<<< @TODO TO BE REMOVED ONCE LIVE IN CODING-STANDARD
37+
'blank_line_between_import_groups' => true,
38+
'class_definition' => [
39+
'multi_line_extends_each_single_line' => true,
40+
'single_item_single_line' => true,
41+
'single_line' => true,
42+
'space_before_parenthesis' => true,
43+
'inline_constructor_arguments' => true,
44+
],
45+
'control_structure_braces' => true,
46+
'no_multiple_statements_per_line' => true,
47+
'no_trailing_comma_in_singleline' => [
48+
'elements' => [
49+
'arguments',
50+
'array_destructuring',
51+
'array',
52+
'group_import',
53+
],
54+
],
55+
'no_useless_nullsafe_operator' => true,
56+
'phpdoc_separation' => [
57+
'groups' => [
58+
['immutable', 'psalm-immutable'],
59+
['param', 'phpstan-param', 'psalm-param'],
60+
['phpstan-pure', 'psalm-pure'],
61+
['readonly', 'psalm-readonly'],
62+
['return', 'phpstan-return', 'psalm-return'],
63+
['template', 'phpstan-template', 'psalm-template'],
64+
['template-covariant', 'phpstan-template-covariant', 'psalm-template-covariant'],
65+
['phpstan-type', 'psalm-type'],
66+
['var', 'phpstan-var', 'psalm-var'],
67+
],
68+
],
69+
'single_line_comment_spacing' => true,
70+
'statement_indentation' => true,
71+
// >>>>>>>>>>>>>>>>>>>>>>>>>
3772
];
3873

3974
$options = [
@@ -42,7 +77,6 @@
4277
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
4378
'customRules' => [
4479
NoCodeSeparatorCommentFixer::name() => true,
45-
SpaceAfterCommentStartFixer::name() => true,
4680
],
4781
];
4882

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## [v4.2.6](https://github.com/codeigniter4/CodeIgniter4/tree/v4.2.6) (2022-09-04)
4+
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.2.5...v4.2.6)
5+
6+
### Fixed Bugs
7+
* fix: AssertionError occurs when using Validation in CLI by @daycry in https://github.com/codeigniter4/CodeIgniter4/pull/6452
8+
* fix: [Validation] JSON data may cause "Array to string conversion" error by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6467
9+
* Fix fatal error gets turned to `0` severity on shutdown handler by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/6472
10+
* Fix redis cache increment/decrement methods by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/6473
11+
* Fix broken caching system when array of allowed parameters used by @JavaDeveloperKiev in https://github.com/codeigniter4/CodeIgniter4/pull/6475
12+
* fix: Strict Validation Rules greater_than/less_than by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6492
13+
14+
### Refactoring
15+
* refactor: fix PHPStan errors by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6470
16+
* Bump `friendsofphp/php-cs-fixer` to `~3.11.0` by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/6471
17+
* Fix overlooked coding style violations by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/6491
18+
319
## [v4.2.5](https://github.com/codeigniter4/CodeIgniter4/tree/v4.2.5) (2022-08-28)
420
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.2.4...v4.2.5)
521

admin/framework/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"kint-php/kint": "^4.2",
1818
"codeigniter/coding-standard": "^1.1",
1919
"fakerphp/faker": "^1.9",
20-
"friendsofphp/php-cs-fixer": "3.6.*",
20+
"friendsofphp/php-cs-fixer": "~3.11.0",
2121
"mikey179/vfsstream": "^1.6",
2222
"nexusphp/cs-config": "^3.3",
2323
"phpunit/phpunit": "^9.1",

app/Config/App.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ class App extends BaseConfig
385385
* Defaults to `Lax` as recommended in this link:
386386
*
387387
* @see https://portswigger.net/web-security/csrf/samesite-cookies
388+
*
388389
* @deprecated `Config\Cookie` $samesite property is used.
389390
*/
390391
public string $CSRFSameSite = 'Lax';

app/Config/ContentSecurityPolicy.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
*/
1616
class ContentSecurityPolicy extends BaseConfig
1717
{
18-
//-------------------------------------------------------------------------
18+
// -------------------------------------------------------------------------
1919
// Broadbrush CSP management
20-
//-------------------------------------------------------------------------
20+
// -------------------------------------------------------------------------
21+
2122
/**
2223
* Default CSP report context
2324
*/
@@ -36,10 +37,10 @@ class ContentSecurityPolicy extends BaseConfig
3637
*/
3738
public bool $upgradeInsecureRequests = false;
3839

39-
//-------------------------------------------------------------------------
40+
// -------------------------------------------------------------------------
4041
// Sources allowed
4142
// Note: once you set a policy to 'none', it cannot be further restricted
42-
//-------------------------------------------------------------------------
43+
// -------------------------------------------------------------------------
4344

4445
/**
4546
* Will default to self if not overridden

app/Config/Routes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
// where controller filters or CSRF protection are bypassed.
2020
// If you don't want to define all routes, please use the Auto Routing (Improved).
2121
// Set `$autoRoutesImproved` to true in `app/Config/Feature.php` and set the following to true.
22-
//$routes->setAutoRoute(false);
22+
// $routes->setAutoRoute(false);
2323

2424
/*
2525
* --------------------------------------------------------------------

app/Config/Security.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ class Security extends BaseConfig
9494
* Defaults to `Lax` as recommended in this link:
9595
*
9696
* @see https://portswigger.net/web-security/csrf/samesite-cookies
97+
*
9798
* @deprecated `Config\Cookie` $samesite property is used.
9899
*/
99100
public string $samesite = 'Lax';

app/Config/Validation.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
class Validation extends BaseConfig
1212
{
13-
//--------------------------------------------------------------------
13+
// --------------------------------------------------------------------
1414
// Setup
15-
//--------------------------------------------------------------------
15+
// --------------------------------------------------------------------
1616

1717
/**
1818
* Stores the classes that contain the
@@ -38,7 +38,7 @@ class Validation extends BaseConfig
3838
'single' => 'CodeIgniter\Validation\Views\single',
3939
];
4040

41-
//--------------------------------------------------------------------
41+
// --------------------------------------------------------------------
4242
// Rules
43-
//--------------------------------------------------------------------
43+
// --------------------------------------------------------------------
4444
}

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
"kint-php/kint": "^4.2",
1818
"codeigniter/coding-standard": "^1.1",
1919
"fakerphp/faker": "^1.9",
20-
"friendsofphp/php-cs-fixer": "3.6.*",
20+
"friendsofphp/php-cs-fixer": "~3.11.0",
2121
"mikey179/vfsstream": "^1.6",
2222
"nexusphp/cs-config": "^3.3",
2323
"nexusphp/tachycardia": "^1.0",
2424
"phpstan/phpstan": "^1.7.1",
2525
"phpunit/phpunit": "^9.1",
2626
"predis/predis": "^1.1 || ^2.0",
27-
"rector/rector": "0.14.0",
27+
"rector/rector": "0.14.1",
2828
"vimeo/psalm": "^4.26"
2929
},
3030
"suggest": {

system/API/ResponseTrait.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ protected function fail($messages, int $status = 400, ?string $code = null, stri
136136
return $this->respond($response, $status, $customMessage);
137137
}
138138

139-
//--------------------------------------------------------------------
139+
// --------------------------------------------------------------------
140140
// Response Helpers
141-
//--------------------------------------------------------------------
141+
// --------------------------------------------------------------------
142142

143143
/**
144144
* Used after successfully creating a new resource.
@@ -290,9 +290,9 @@ protected function failServerError(string $description = 'Internal Server Error'
290290
return $this->fail($description, $this->codes['server_error'], $code, $message);
291291
}
292292

293-
//--------------------------------------------------------------------
293+
// --------------------------------------------------------------------
294294
// Utility Methods
295-
//--------------------------------------------------------------------
295+
// --------------------------------------------------------------------
296296

297297
/**
298298
* Handles formatting a response. Currently makes some heavy assumptions

system/CLI/CLI.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,9 @@ public static function promptByMultipleKeys(string $text, array $options): array
362362
return $input;
363363
}
364364

365-
//--------------------------------------------------------------------
365+
// --------------------------------------------------------------------
366366
// Utility for promptBy...
367-
//--------------------------------------------------------------------
367+
// --------------------------------------------------------------------
368368

369369
/**
370370
* Validation for $options in promptByKey() and promptByMultipleKeys(). Return an error if $options is an empty array.
@@ -390,9 +390,9 @@ private static function printKeysAndValues(array $options): void
390390
}
391391
}
392392

393-
//--------------------------------------------------------------------
393+
// --------------------------------------------------------------------
394394
// End Utility for promptBy...
395-
//--------------------------------------------------------------------
395+
// --------------------------------------------------------------------
396396

397397
/**
398398
* Validate one prompt "field" at a time
@@ -849,9 +849,9 @@ public static function wrap(?string $string = null, int $max = 0, int $padLeft =
849849
return $lines;
850850
}
851851

852-
//--------------------------------------------------------------------
852+
// --------------------------------------------------------------------
853853
// Command-Line 'URI' support
854-
//--------------------------------------------------------------------
854+
// --------------------------------------------------------------------
855855

856856
/**
857857
* Parses the command line it was called from and collects all

0 commit comments

Comments
 (0)