Skip to content

Commit 5b00242

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.4
Conflicts: phpstan-baseline.php
2 parents 9151860 + dd7a139 commit 5b00242

66 files changed

Lines changed: 370 additions & 335 deletions

File tree

Some content is hidden

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

.php-cs-fixer.dist.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@
4444
]);
4545

4646
$overrides = [
47+
'php_unit_data_provider_name' => [
48+
'prefix' => 'provide',
49+
'suffix' => '',
50+
],
4751
'php_unit_data_provider_return_type' => true,
4852
'no_extra_blank_lines' => [
4953
'tokens' => [

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
]);
3131

3232
$overrides = [
33+
'php_unit_data_provider_name' => [
34+
'prefix' => 'provide',
35+
'suffix' => '',
36+
],
3337
'php_unit_data_provider_return_type' => true,
3438
'no_extra_blank_lines' => [
3539
'tokens' => [

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@
5353
'use',
5454
],
5555
],
56+
'php_unit_data_provider_name' => [
57+
'prefix' => 'provide',
58+
'suffix' => '',
59+
],
5660
];
5761

5862
$options = [

admin/RELEASE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ the existing content.
5555
```
5656
* Vet the **admin/** folders for any removed hidden files (Action deploy scripts
5757
*do not remove these*)
58+
* git diff --name-status origin/master admin/
5859
* Merge any Security Advisory PRs in private forks
5960

6061
## Process

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"phpunit/phpcov": "^8.2",
3131
"phpunit/phpunit": "^9.1",
3232
"predis/predis": "^1.1 || ^2.0",
33-
"rector/rector": "0.17.7",
33+
"rector/rector": "0.17.10",
3434
"vimeo/psalm": "^5.0"
3535
},
3636
"suggest": {

phpstan-baseline.php

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
'count' => 1,
77
'path' => __DIR__ . '/system/BaseModel.php',
88
];
9-
$ignoreErrors[] = [
10-
'message' => '#^Method CodeIgniter\\\\Cache\\\\CacheInterface\\:\\:initialize\\(\\) has no return type specified\\.$#',
11-
'count' => 1,
12-
'path' => __DIR__ . '/system/Cache/CacheInterface.php',
13-
];
149
$ignoreErrors[] = [
1510
'message' => '#^Method CodeIgniter\\\\Cache\\\\Handlers\\\\BaseHandler\\:\\:deleteMatching\\(\\) has no return type specified\\.$#',
1611
'count' => 1,
@@ -26,11 +21,6 @@
2621
'count' => 1,
2722
'path' => __DIR__ . '/system/Cache/Handlers/DummyHandler.php',
2823
];
29-
$ignoreErrors[] = [
30-
'message' => '#^Method CodeIgniter\\\\Cache\\\\Handlers\\\\DummyHandler\\:\\:initialize\\(\\) has no return type specified\\.$#',
31-
'count' => 1,
32-
'path' => __DIR__ . '/system/Cache/Handlers/DummyHandler.php',
33-
];
3424
$ignoreErrors[] = [
3525
'message' => '#^Method CodeIgniter\\\\Cache\\\\Handlers\\\\DummyHandler\\:\\:remember\\(\\) has parameter \\$callback with no signature specified for Closure\\.$#',
3626
'count' => 1,
@@ -41,51 +31,26 @@
4131
'count' => 1,
4232
'path' => __DIR__ . '/system/Cache/Handlers/FileHandler.php',
4333
];
44-
$ignoreErrors[] = [
45-
'message' => '#^Method CodeIgniter\\\\Cache\\\\Handlers\\\\FileHandler\\:\\:initialize\\(\\) has no return type specified\\.$#',
46-
'count' => 1,
47-
'path' => __DIR__ . '/system/Cache/Handlers/FileHandler.php',
48-
];
4934
$ignoreErrors[] = [
5035
'message' => '#^Method CodeIgniter\\\\Cache\\\\Handlers\\\\MemcachedHandler\\:\\:deleteMatching\\(\\) has no return type specified\\.$#',
5136
'count' => 1,
5237
'path' => __DIR__ . '/system/Cache/Handlers/MemcachedHandler.php',
5338
];
54-
$ignoreErrors[] = [
55-
'message' => '#^Method CodeIgniter\\\\Cache\\\\Handlers\\\\MemcachedHandler\\:\\:initialize\\(\\) has no return type specified\\.$#',
56-
'count' => 1,
57-
'path' => __DIR__ . '/system/Cache/Handlers/MemcachedHandler.php',
58-
];
5939
$ignoreErrors[] = [
6040
'message' => '#^Method CodeIgniter\\\\Cache\\\\Handlers\\\\PredisHandler\\:\\:deleteMatching\\(\\) has no return type specified\\.$#',
6141
'count' => 1,
6242
'path' => __DIR__ . '/system/Cache/Handlers/PredisHandler.php',
6343
];
64-
$ignoreErrors[] = [
65-
'message' => '#^Method CodeIgniter\\\\Cache\\\\Handlers\\\\PredisHandler\\:\\:initialize\\(\\) has no return type specified\\.$#',
66-
'count' => 1,
67-
'path' => __DIR__ . '/system/Cache/Handlers/PredisHandler.php',
68-
];
6944
$ignoreErrors[] = [
7045
'message' => '#^Method CodeIgniter\\\\Cache\\\\Handlers\\\\RedisHandler\\:\\:deleteMatching\\(\\) has no return type specified\\.$#',
7146
'count' => 1,
7247
'path' => __DIR__ . '/system/Cache/Handlers/RedisHandler.php',
7348
];
74-
$ignoreErrors[] = [
75-
'message' => '#^Method CodeIgniter\\\\Cache\\\\Handlers\\\\RedisHandler\\:\\:initialize\\(\\) has no return type specified\\.$#',
76-
'count' => 1,
77-
'path' => __DIR__ . '/system/Cache/Handlers/RedisHandler.php',
78-
];
7949
$ignoreErrors[] = [
8050
'message' => '#^Method CodeIgniter\\\\Cache\\\\Handlers\\\\WincacheHandler\\:\\:deleteMatching\\(\\) has no return type specified\\.$#',
8151
'count' => 1,
8252
'path' => __DIR__ . '/system/Cache/Handlers/WincacheHandler.php',
8353
];
84-
$ignoreErrors[] = [
85-
'message' => '#^Method CodeIgniter\\\\Cache\\\\Handlers\\\\WincacheHandler\\:\\:initialize\\(\\) has no return type specified\\.$#',
86-
'count' => 1,
87-
'path' => __DIR__ . '/system/Cache/Handlers/WincacheHandler.php',
88-
];
8954
$ignoreErrors[] = [
9055
'message' => '#^Method CodeIgniter\\\\CodeIgniter\\:\\:bootstrapEnvironment\\(\\) has no return type specified\\.$#',
9156
'count' => 1,
@@ -916,41 +881,16 @@
916881
'count' => 1,
917882
'path' => __DIR__ . '/system/Entity/Entity.php',
918883
];
919-
$ignoreErrors[] = [
920-
'message' => '#^Method CodeIgniter\\\\Events\\\\Events\\:\\:initialize\\(\\) has no return type specified\\.$#',
921-
'count' => 1,
922-
'path' => __DIR__ . '/system/Events/Events.php',
923-
];
924-
$ignoreErrors[] = [
925-
'message' => '#^Method CodeIgniter\\\\Events\\\\Events\\:\\:on\\(\\) has no return type specified\\.$#',
926-
'count' => 1,
927-
'path' => __DIR__ . '/system/Events/Events.php',
928-
];
929884
$ignoreErrors[] = [
930885
'message' => '#^Method CodeIgniter\\\\Events\\\\Events\\:\\:on\\(\\) has parameter \\$callback with no signature specified for callable\\.$#',
931886
'count' => 1,
932887
'path' => __DIR__ . '/system/Events/Events.php',
933888
];
934-
$ignoreErrors[] = [
935-
'message' => '#^Method CodeIgniter\\\\Events\\\\Events\\:\\:removeAllListeners\\(\\) has no return type specified\\.$#',
936-
'count' => 1,
937-
'path' => __DIR__ . '/system/Events/Events.php',
938-
];
939889
$ignoreErrors[] = [
940890
'message' => '#^Method CodeIgniter\\\\Events\\\\Events\\:\\:removeListener\\(\\) has parameter \\$listener with no signature specified for callable\\.$#',
941891
'count' => 1,
942892
'path' => __DIR__ . '/system/Events/Events.php',
943893
];
944-
$ignoreErrors[] = [
945-
'message' => '#^Method CodeIgniter\\\\Events\\\\Events\\:\\:setFiles\\(\\) has no return type specified\\.$#',
946-
'count' => 1,
947-
'path' => __DIR__ . '/system/Events/Events.php',
948-
];
949-
$ignoreErrors[] = [
950-
'message' => '#^Method CodeIgniter\\\\Events\\\\Events\\:\\:simulate\\(\\) has no return type specified\\.$#',
951-
'count' => 1,
952-
'path' => __DIR__ . '/system/Events/Events.php',
953-
];
954894
$ignoreErrors[] = [
955895
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\CastException\\:\\:forInvalidJsonFormatException\\(\\) has no return type specified\\.$#',
956896
'count' => 1,
@@ -2261,11 +2201,6 @@
22612201
'count' => 1,
22622202
'path' => __DIR__ . '/system/Test/Mock/MockCache.php',
22632203
];
2264-
$ignoreErrors[] = [
2265-
'message' => '#^Method CodeIgniter\\\\Test\\\\Mock\\\\MockCache\\:\\:initialize\\(\\) has no return type specified\\.$#',
2266-
'count' => 1,
2267-
'path' => __DIR__ . '/system/Test/Mock/MockCache.php',
2268-
];
22692204
$ignoreErrors[] = [
22702205
'message' => '#^Method CodeIgniter\\\\Test\\\\Mock\\\\MockCache\\:\\:remember\\(\\) has parameter \\$callback with no signature specified for Closure\\.$#',
22712206
'count' => 1,
@@ -2736,10 +2671,5 @@
27362671
'count' => 1,
27372672
'path' => __DIR__ . '/system/View/View.php',
27382673
];
2739-
$ignoreErrors[] = [
2740-
'message' => '#^Property CodeIgniter\\\\View\\\\View\\:\\:\\$tempData has no type specified\\.$#',
2741-
'count' => 1,
2742-
'path' => __DIR__ . '/system/View/View.php',
2743-
];
27442674

27452675
return ['parameters' => ['ignoreErrors' => $ignoreErrors]];

system/BaseModel.php

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ public function insertBatch(?array $set = null, ?bool $escape = null, int $batch
853853

854854
// Must be called first so we don't
855855
// strip out created_at values.
856-
$row = $this->doProtectFields($row);
856+
$row = $this->doProtectFieldsForInsert($row);
857857

858858
// Set created_at and updated_at with same time
859859
$date = $this->setDate();
@@ -1228,10 +1228,10 @@ public function protect(bool $protect = true)
12281228
}
12291229

12301230
/**
1231-
* Ensures that only the fields that are allowed to be updated
1232-
* are in the data array.
1231+
* Ensures that only the fields that are allowed to be updated are
1232+
* in the data array.
12331233
*
1234-
* Used by insert() and update() to protect against mass assignment
1234+
* Used by update() and updateBatch() to protect against mass assignment
12351235
* vulnerabilities.
12361236
*
12371237
* @param array $data Data
@@ -1257,6 +1257,22 @@ protected function doProtectFields(array $data): array
12571257
return $data;
12581258
}
12591259

1260+
/**
1261+
* Ensures that only the fields that are allowed to be inserted are in
1262+
* the data array.
1263+
*
1264+
* Used by insert() and insertBatch() to protect against mass assignment
1265+
* vulnerabilities.
1266+
*
1267+
* @param array $data Data
1268+
*
1269+
* @throws DataException
1270+
*/
1271+
protected function doProtectFieldsForInsert(array $data): array
1272+
{
1273+
return $this->doProtectFields($data);
1274+
}
1275+
12601276
/**
12611277
* Sets the date or current date if null value is passed.
12621278
*

system/Cache/CacheInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ interface CacheInterface
1818
{
1919
/**
2020
* Takes care of any handler-specific setup that must be done.
21+
*
22+
* @return void
2123
*/
2224
public function initialize();
2325

system/Config/Services.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ public static function pager(?PagerConfig $config = null, ?RendererInterface $vi
461461
}
462462

463463
$config ??= config(PagerConfig::class);
464-
$view ??= AppServices::renderer();
464+
$view ??= AppServices::renderer(null, null, false);
465465

466466
return new Pager($config, $view);
467467
}

system/Events/Events.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ class Events
6363

6464
/**
6565
* Ensures that we have a events file ready.
66+
*
67+
* @return void
6668
*/
6769
public static function initialize()
6870
{
@@ -108,6 +110,8 @@ public static function initialize()
108110
* @param string $eventName
109111
* @param callable $callback
110112
* @param int $priority
113+
*
114+
* @return void
111115
*/
112116
public static function on($eventName, $callback, $priority = self::PRIORITY_NORMAL)
113117
{
@@ -222,6 +226,8 @@ public static function removeListener($eventName, callable $listener): bool
222226
* removed, otherwise all listeners for all events are removed.
223227
*
224228
* @param string|null $eventName
229+
*
230+
* @return void
225231
*/
226232
public static function removeAllListeners($eventName = null)
227233
{
@@ -234,6 +240,8 @@ public static function removeAllListeners($eventName = null)
234240

235241
/**
236242
* Sets the path to the file that routes are read from.
243+
*
244+
* @return void
237245
*/
238246
public static function setFiles(array $files)
239247
{
@@ -254,6 +262,8 @@ public static function getFiles()
254262
* Turns simulation on or off. When on, events will not be triggered,
255263
* simply logged. Useful during testing when you don't actually want
256264
* the tests to run.
265+
*
266+
* @return void
257267
*/
258268
public static function simulate(bool $choice = true)
259269
{

0 commit comments

Comments
 (0)