Skip to content

Commit bb9e60e

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.5
Conflicts: phpstan-baseline.php system/BaseModel.php system/Controller.php system/Helpers/array_helper.php
2 parents 9d6ad18 + 4433c90 commit bb9e60e

Some content is hidden

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

55 files changed

+185
-157
lines changed

app/Config/Boot/development.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
|
1111
| If you set 'display_errors' to '1', CI4's detailed error report will show.
1212
*/
13-
error_reporting(-1);
13+
error_reporting(E_ALL);
1414
ini_set('display_errors', '1');
1515

1616
/*

app/Config/Boot/testing.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
| make sure they don't make it to production. And save us hours of
1515
| painful debugging.
1616
*/
17-
error_reporting(-1);
17+
error_reporting(E_ALL);
1818
ini_set('display_errors', '1');
1919

2020
/*

phpstan-baseline.php

Lines changed: 28 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
];
1919
$ignoreErrors[] = [
2020
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
21-
'count' => 13,
21+
'count' => 10,
2222
'path' => __DIR__ . '/system/Autoloader/FileLocator.php',
2323
];
2424
$ignoreErrors[] = [
@@ -33,7 +33,7 @@
3333
];
3434
$ignoreErrors[] = [
3535
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
36-
'count' => 14,
36+
'count' => 10,
3737
'path' => __DIR__ . '/system/BaseModel.php',
3838
];
3939
$ignoreErrors[] = [
@@ -63,7 +63,7 @@
6363
];
6464
$ignoreErrors[] = [
6565
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
66-
'count' => 5,
66+
'count' => 2,
6767
'path' => __DIR__ . '/system/CLI/BaseCommand.php',
6868
];
6969
$ignoreErrors[] = [
@@ -83,7 +83,7 @@
8383
];
8484
$ignoreErrors[] = [
8585
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
86-
'count' => 6,
86+
'count' => 1,
8787
'path' => __DIR__ . '/system/CLI/CLI.php',
8888
];
8989
$ignoreErrors[] = [
@@ -983,7 +983,7 @@
983983
];
984984
$ignoreErrors[] = [
985985
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
986-
'count' => 10,
986+
'count' => 2,
987987
'path' => __DIR__ . '/system/Database/BaseResult.php',
988988
];
989989
$ignoreErrors[] = [
@@ -1098,7 +1098,7 @@
10981098
];
10991099
$ignoreErrors[] = [
11001100
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
1101-
'count' => 8,
1101+
'count' => 6,
11021102
'path' => __DIR__ . '/system/Database/MigrationRunner.php',
11031103
];
11041104
$ignoreErrors[] = [
@@ -1146,11 +1146,6 @@
11461146
'count' => 1,
11471147
'path' => __DIR__ . '/system/Database/MigrationRunner.php',
11481148
];
1149-
$ignoreErrors[] = [
1150-
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
1151-
'count' => 1,
1152-
'path' => __DIR__ . '/system/Database/MySQLi/Builder.php',
1153-
];
11541149
$ignoreErrors[] = [
11551150
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
11561151
'count' => 12,
@@ -1483,7 +1478,7 @@
14831478
];
14841479
$ignoreErrors[] = [
14851480
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
1486-
'count' => 15,
1481+
'count' => 10,
14871482
'path' => __DIR__ . '/system/Database/SQLSRV/Builder.php',
14881483
];
14891484
$ignoreErrors[] = [
@@ -1533,7 +1528,7 @@
15331528
];
15341529
$ignoreErrors[] = [
15351530
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
1536-
'count' => 6,
1531+
'count' => 5,
15371532
'path' => __DIR__ . '/system/Database/SQLSRV/Forge.php',
15381533
];
15391534
$ignoreErrors[] = [
@@ -1653,7 +1648,7 @@
16531648
];
16541649
$ignoreErrors[] = [
16551650
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
1656-
'count' => 3,
1651+
'count' => 2,
16571652
'path' => __DIR__ . '/system/Database/SQLite3/Table.php',
16581653
];
16591654
$ignoreErrors[] = [
@@ -1701,36 +1696,21 @@
17011696
'count' => 3,
17021697
'path' => __DIR__ . '/system/Debug/Exceptions.php',
17031698
];
1704-
$ignoreErrors[] = [
1705-
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
1706-
'count' => 1,
1707-
'path' => __DIR__ . '/system/Debug/Iterator.php',
1708-
];
17091699
$ignoreErrors[] = [
17101700
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
17111701
'count' => 5,
17121702
'path' => __DIR__ . '/system/Debug/Timer.php',
17131703
];
17141704
$ignoreErrors[] = [
17151705
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
1716-
'count' => 5,
1706+
'count' => 2,
17171707
'path' => __DIR__ . '/system/Debug/Toolbar.php',
17181708
];
1719-
$ignoreErrors[] = [
1720-
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
1721-
'count' => 1,
1722-
'path' => __DIR__ . '/system/Debug/Toolbar/Collectors/Database.php',
1723-
];
17241709
$ignoreErrors[] = [
17251710
'message' => '#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#',
17261711
'count' => 1,
17271712
'path' => __DIR__ . '/system/Debug/Toolbar/Collectors/Database.php',
17281713
];
1729-
$ignoreErrors[] = [
1730-
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
1731-
'count' => 1,
1732-
'path' => __DIR__ . '/system/Debug/Toolbar/Collectors/History.php',
1733-
];
17341714
$ignoreErrors[] = [
17351715
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
17361716
'count' => 2,
@@ -1828,7 +1808,7 @@
18281808
];
18291809
$ignoreErrors[] = [
18301810
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
1831-
'count' => 4,
1811+
'count' => 3,
18321812
'path' => __DIR__ . '/system/Entity/Entity.php',
18331813
];
18341814
$ignoreErrors[] = [
@@ -1893,7 +1873,7 @@
18931873
];
18941874
$ignoreErrors[] = [
18951875
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
1896-
'count' => 2,
1876+
'count' => 1,
18971877
'path' => __DIR__ . '/system/HTTP/CLIRequest.php',
18981878
];
18991879
$ignoreErrors[] = [
@@ -1913,7 +1893,7 @@
19131893
];
19141894
$ignoreErrors[] = [
19151895
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
1916-
'count' => 9,
1896+
'count' => 7,
19171897
'path' => __DIR__ . '/system/HTTP/ContentSecurityPolicy.php',
19181898
];
19191899
$ignoreErrors[] = [
@@ -1966,11 +1946,6 @@
19661946
'count' => 1,
19671947
'path' => __DIR__ . '/system/HTTP/Files/FileCollection.php',
19681948
];
1969-
$ignoreErrors[] = [
1970-
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
1971-
'count' => 1,
1972-
'path' => __DIR__ . '/system/HTTP/Files/FileCollection.php',
1973-
];
19741949
$ignoreErrors[] = [
19751950
'message' => '#^Only booleans are allowed in &&, array given on the right side\\.$#',
19761951
'count' => 2,
@@ -2068,7 +2043,7 @@
20682043
];
20692044
$ignoreErrors[] = [
20702045
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
2071-
'count' => 3,
2046+
'count' => 2,
20722047
'path' => __DIR__ . '/system/HTTP/Negotiate.php',
20732048
];
20742049
$ignoreErrors[] = [
@@ -2123,7 +2098,7 @@
21232098
];
21242099
$ignoreErrors[] = [
21252100
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
2126-
'count' => 6,
2101+
'count' => 5,
21272102
'path' => __DIR__ . '/system/HTTP/Response.php',
21282103
];
21292104
$ignoreErrors[] = [
@@ -2201,11 +2176,6 @@
22012176
'count' => 4,
22022177
'path' => __DIR__ . '/system/HTTP/UserAgent.php',
22032178
];
2204-
$ignoreErrors[] = [
2205-
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
2206-
'count' => 2,
2207-
'path' => __DIR__ . '/system/Helpers/array_helper.php',
2208-
];
22092179
$ignoreErrors[] = [
22102180
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
22112181
'count' => 1,
@@ -2293,7 +2263,7 @@
22932263
];
22942264
$ignoreErrors[] = [
22952265
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
2296-
'count' => 4,
2266+
'count' => 1,
22972267
'path' => __DIR__ . '/system/Helpers/form_helper.php',
22982268
];
22992269
$ignoreErrors[] = [
@@ -2313,7 +2283,7 @@
23132283
];
23142284
$ignoreErrors[] = [
23152285
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
2316-
'count' => 6,
2286+
'count' => 5,
23172287
'path' => __DIR__ . '/system/Helpers/html_helper.php',
23182288
];
23192289
$ignoreErrors[] = [
@@ -2333,7 +2303,7 @@
23332303
];
23342304
$ignoreErrors[] = [
23352305
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
2336-
'count' => 3,
2306+
'count' => 1,
23372307
'path' => __DIR__ . '/system/Helpers/text_helper.php',
23382308
];
23392309
$ignoreErrors[] = [
@@ -2343,7 +2313,7 @@
23432313
];
23442314
$ignoreErrors[] = [
23452315
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
2346-
'count' => 2,
2316+
'count' => 1,
23472317
'path' => __DIR__ . '/system/Helpers/url_helper.php',
23482318
];
23492319
$ignoreErrors[] = [
@@ -2486,19 +2456,14 @@
24862456
'count' => 1,
24872457
'path' => __DIR__ . '/system/Log/Handlers/FileHandler.php',
24882458
];
2489-
$ignoreErrors[] = [
2490-
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
2491-
'count' => 1,
2492-
'path' => __DIR__ . '/system/Log/Logger.php',
2493-
];
24942459
$ignoreErrors[] = [
24952460
'message' => '#^Parameter \\#1 \\$level \\(string\\) of method CodeIgniter\\\\Log\\\\Logger\\:\\:log\\(\\) should be contravariant with parameter \\$level \\(mixed\\) of method Psr\\\\Log\\\\LoggerInterface\\:\\:log\\(\\)$#',
24962461
'count' => 1,
24972462
'path' => __DIR__ . '/system/Log/Logger.php',
24982463
];
24992464
$ignoreErrors[] = [
25002465
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
2501-
'count' => 15,
2466+
'count' => 13,
25022467
'path' => __DIR__ . '/system/Model.php',
25032468
];
25042469
$ignoreErrors[] = [
@@ -2583,7 +2548,7 @@
25832548
];
25842549
$ignoreErrors[] = [
25852550
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
2586-
'count' => 6,
2551+
'count' => 3,
25872552
'path' => __DIR__ . '/system/Router/AutoRouter.php',
25882553
];
25892554
$ignoreErrors[] = [
@@ -2763,7 +2728,7 @@
27632728
];
27642729
$ignoreErrors[] = [
27652730
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
2766-
'count' => 5,
2731+
'count' => 4,
27672732
'path' => __DIR__ . '/system/Router/Router.php',
27682733
];
27692734
$ignoreErrors[] = [
@@ -2888,7 +2853,7 @@
28882853
];
28892854
$ignoreErrors[] = [
28902855
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
2891-
'count' => 3,
2856+
'count' => 2,
28922857
'path' => __DIR__ . '/system/Session/Handlers/MemcachedHandler.php',
28932858
];
28942859
$ignoreErrors[] = [
@@ -2913,7 +2878,7 @@
29132878
];
29142879
$ignoreErrors[] = [
29152880
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
2916-
'count' => 13,
2881+
'count' => 12,
29172882
'path' => __DIR__ . '/system/Session/Session.php',
29182883
];
29192884
$ignoreErrors[] = [
@@ -3123,7 +3088,7 @@
31233088
];
31243089
$ignoreErrors[] = [
31253090
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
3126-
'count' => 7,
3091+
'count' => 6,
31273092
'path' => __DIR__ . '/system/Test/DOMParser.php',
31283093
];
31293094
$ignoreErrors[] = [
@@ -3481,11 +3446,6 @@
34813446
'count' => 1,
34823447
'path' => __DIR__ . '/system/Validation/CreditCardRules.php',
34833448
];
3484-
$ignoreErrors[] = [
3485-
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
3486-
'count' => 1,
3487-
'path' => __DIR__ . '/system/Validation/DotArrayFilter.php',
3488-
];
34893449
$ignoreErrors[] = [
34903450
'message' => '#^Only booleans are allowed in a negated boolean, array\\|null given\\.$#',
34913451
'count' => 6,
@@ -3498,7 +3458,7 @@
34983458
];
34993459
$ignoreErrors[] = [
35003460
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
3501-
'count' => 11,
3461+
'count' => 8,
35023462
'path' => __DIR__ . '/system/Validation/Rules.php',
35033463
];
35043464
$ignoreErrors[] = [
@@ -3538,7 +3498,7 @@
35383498
];
35393499
$ignoreErrors[] = [
35403500
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
3541-
'count' => 9,
3501+
'count' => 6,
35423502
'path' => __DIR__ . '/system/View/Parser.php',
35433503
];
35443504
$ignoreErrors[] = [
@@ -3548,12 +3508,7 @@
35483508
];
35493509
$ignoreErrors[] = [
35503510
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
3551-
'count' => 1,
3552-
'path' => __DIR__ . '/system/View/Plugins.php',
3553-
];
3554-
$ignoreErrors[] = [
3555-
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
3556-
'count' => 9,
3511+
'count' => 7,
35573512
'path' => __DIR__ . '/system/View/Table.php',
35583513
];
35593514
$ignoreErrors[] = [

rector.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Rector\CodeQuality\Rector\BooleanAnd\SimplifyEmptyArrayCheckRector;
1515
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
16+
use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector;
1617
use Rector\CodeQuality\Rector\Expression\InlineIfToExplicitIfRector;
1718
use Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector;
1819
use Rector\CodeQuality\Rector\FuncCall\ChangeArrayPushToArrayAssignRector;
@@ -158,6 +159,7 @@
158159
$rectorConfig->rule(FuncGetArgsToVariadicParamRector::class);
159160
$rectorConfig->rule(MakeInheritedMethodVisibilitySameAsParentRector::class);
160161
$rectorConfig->rule(SimplifyEmptyArrayCheckRector::class);
162+
$rectorConfig->rule(SimplifyEmptyCheckOnEmptyArrayRector::class);
161163
$rectorConfig->rule(StringClassNameToClassConstantRector::class);
162164
$rectorConfig->rule(PrivatizeFinalClassPropertyRector::class);
163165
$rectorConfig->rule(CompleteDynamicPropertiesRector::class);

spark

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ if (version_compare(PHP_VERSION, $minPhpVersion, '<')) {
3939
}
4040

4141
// We want errors to be shown when using it from the CLI.
42-
error_reporting(-1);
42+
error_reporting(E_ALL);
4343
ini_set('display_errors', '1');
4444

4545
/**

0 commit comments

Comments
 (0)