Skip to content

Commit 317bc5f

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.4
Conflicts: phpstan-baseline.php system/Config/Factories.php
2 parents c9e99f7 + 6c22cce commit 317bc5f

65 files changed

Lines changed: 248 additions & 294 deletions

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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
'prefix' => 'provide',
4949
'suffix' => '',
5050
],
51+
'php_unit_data_provider_static' => true,
5152
'php_unit_data_provider_return_type' => true,
5253
'no_extra_blank_lines' => [
5354
'tokens' => [

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
'prefix' => 'provide',
3535
'suffix' => '',
3636
],
37+
'php_unit_data_provider_static' => true,
3738
'php_unit_data_provider_return_type' => true,
3839
'no_extra_blank_lines' => [
3940
'tokens' => [

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@
5353
'use',
5454
],
5555
],
56-
'php_unit_data_provider_name' => [
56+
'php_unit_data_provider_static' => true,
57+
'php_unit_data_provider_name' => [
5758
'prefix' => 'provide',
5859
'suffix' => '',
5960
],

phpstan-baseline.php

Lines changed: 26 additions & 161 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
<?php declare(strict_types = 1);
22

33
$ignoreErrors = [];
4+
$ignoreErrors[] = [
5+
'message' => '#^PHPDoc type array of property Config\\\\View\\:\\:\\$filters is not covariant with PHPDoc type array\\<string, callable\\-string\\> of overridden property CodeIgniter\\\\Config\\\\View\\:\\:\\$filters\\.$#',
6+
'count' => 1,
7+
'path' => __DIR__ . '/app/Config/View.php',
8+
];
9+
$ignoreErrors[] = [
10+
'message' => '#^PHPDoc type array of property Config\\\\View\\:\\:\\$plugins is not covariant with PHPDoc type array\\<string, callable\\-string\\> of overridden property CodeIgniter\\\\Config\\\\View\\:\\:\\$plugins\\.$#',
11+
'count' => 1,
12+
'path' => __DIR__ . '/app/Config/View.php',
13+
];
14+
$ignoreErrors[] = [
15+
'message' => '#^Parameter \\#1 \\$callback of function spl_autoload_register expects \\(callable\\(string\\)\\: void\\)\\|null, array\\{\\$this\\(CodeIgniter\\\\Autoloader\\\\Autoloader\\), \'loadClass\'\\} given\\.$#',
16+
'count' => 1,
17+
'path' => __DIR__ . '/system/Autoloader/Autoloader.php',
18+
];
19+
$ignoreErrors[] = [
20+
'message' => '#^Parameter \\#1 \\$callback of function spl_autoload_register expects \\(callable\\(string\\)\\: void\\)\\|null, array\\{\\$this\\(CodeIgniter\\\\Autoloader\\\\Autoloader\\), \'loadClassmap\'\\} given\\.$#',
21+
'count' => 1,
22+
'path' => __DIR__ . '/system/Autoloader/Autoloader.php',
23+
];
424
$ignoreErrors[] = [
525
'message' => '#^Method CodeIgniter\\\\BaseModel\\:\\:chunk\\(\\) has parameter \\$userFunc with no signature specified for Closure\\.$#',
626
'count' => 1,
@@ -297,67 +317,22 @@
297317
'path' => __DIR__ . '/system/ComposerScripts.php',
298318
];
299319
$ignoreErrors[] = [
300-
'message' => '#^Method CodeIgniter\\\\Config\\\\BaseConfig\\:\\:registerProperties\\(\\) has no return type specified\\.$#',
320+
'message' => '#^Property CodeIgniter\\\\Config\\\\View\\:\\:\\$coreFilters type has no signature specified for callable\\.$#',
301321
'count' => 1,
302-
'path' => __DIR__ . '/system/Config/BaseConfig.php',
303-
];
304-
$ignoreErrors[] = [
305-
'message' => '#^Method CodeIgniter\\\\Config\\\\BaseService\\:\\:injectMock\\(\\) has no return type specified\\.$#',
306-
'count' => 1,
307-
'path' => __DIR__ . '/system/Config/BaseService.php',
308-
];
309-
$ignoreErrors[] = [
310-
'message' => '#^Method CodeIgniter\\\\Config\\\\BaseService\\:\\:reset\\(\\) has no return type specified\\.$#',
311-
'count' => 1,
312-
'path' => __DIR__ . '/system/Config/BaseService.php',
313-
];
314-
$ignoreErrors[] = [
315-
'message' => '#^Method CodeIgniter\\\\Config\\\\BaseService\\:\\:resetSingle\\(\\) has no return type specified\\.$#',
316-
'count' => 1,
317-
'path' => __DIR__ . '/system/Config/BaseService.php',
318-
];
319-
$ignoreErrors[] = [
320-
'message' => '#^Method CodeIgniter\\\\Config\\\\Config\\:\\:injectMock\\(\\) has no return type specified\\.$#',
321-
'count' => 1,
322-
'path' => __DIR__ . '/system/Config/Config.php',
323-
];
324-
$ignoreErrors[] = [
325-
'message' => '#^Method CodeIgniter\\\\Config\\\\Config\\:\\:reset\\(\\) has no return type specified\\.$#',
326-
'count' => 1,
327-
'path' => __DIR__ . '/system/Config/Config.php',
328-
];
329-
$ignoreErrors[] = [
330-
'message' => '#^Method CodeIgniter\\\\Config\\\\DotEnv\\:\\:setVariable\\(\\) has no return type specified\\.$#',
331-
'count' => 1,
332-
'path' => __DIR__ . '/system/Config/DotEnv.php',
333-
];
334-
$ignoreErrors[] = [
335-
'message' => '#^Method CodeIgniter\\\\Config\\\\Factories\\:\\:injectMock\\(\\) has no return type specified\\.$#',
336-
'count' => 1,
337-
'path' => __DIR__ . '/system/Config/Factories.php',
338-
];
339-
$ignoreErrors[] = [
340-
'message' => '#^Method CodeIgniter\\\\Config\\\\Factories\\:\\:reset\\(\\) has no return type specified\\.$#',
341-
'count' => 1,
342-
'path' => __DIR__ . '/system/Config/Factories.php',
343-
];
344-
$ignoreErrors[] = [
345-
'message' => '#^Property CodeIgniter\\\\Config\\\\ForeignCharacters\\:\\:\\$characterList has no type specified\\.$#',
346-
'count' => 1,
347-
'path' => __DIR__ . '/system/Config/ForeignCharacters.php',
322+
'path' => __DIR__ . '/system/Config/View.php',
348323
];
349324
$ignoreErrors[] = [
350-
'message' => '#^Method CodeIgniter\\\\Config\\\\Publisher\\:\\:registerProperties\\(\\) has no return type specified\\.$#',
325+
'message' => '#^Property CodeIgniter\\\\Config\\\\View\\:\\:\\$corePlugins type has no signature specified for callable\\.$#',
351326
'count' => 1,
352-
'path' => __DIR__ . '/system/Config/Publisher.php',
327+
'path' => __DIR__ . '/system/Config/View.php',
353328
];
354329
$ignoreErrors[] = [
355-
'message' => '#^Property CodeIgniter\\\\Config\\\\View\\:\\:\\$filters has no type specified\\.$#',
330+
'message' => '#^Property CodeIgniter\\\\Config\\\\View\\:\\:\\$filters type has no signature specified for callable\\.$#',
356331
'count' => 1,
357332
'path' => __DIR__ . '/system/Config/View.php',
358333
];
359334
$ignoreErrors[] = [
360-
'message' => '#^Property CodeIgniter\\\\Config\\\\View\\:\\:\\$plugins has no type specified\\.$#',
335+
'message' => '#^Property CodeIgniter\\\\Config\\\\View\\:\\:\\$plugins type has no signature specified for callable\\.$#',
361336
'count' => 1,
362337
'path' => __DIR__ . '/system/Config/View.php',
363338
];
@@ -816,46 +791,6 @@
816791
'count' => 2,
817792
'path' => __DIR__ . '/system/Debug/Toolbar/Collectors/Views.php',
818793
];
819-
$ignoreErrors[] = [
820-
'message' => '#^Method CodeIgniter\\\\Email\\\\Email\\:\\:SMTPEnd\\(\\) has no return type specified\\.$#',
821-
'count' => 1,
822-
'path' => __DIR__ . '/system/Email/Email.php',
823-
];
824-
$ignoreErrors[] = [
825-
'message' => '#^Method CodeIgniter\\\\Email\\\\Email\\:\\:appendAttachments\\(\\) has no return type specified\\.$#',
826-
'count' => 1,
827-
'path' => __DIR__ . '/system/Email/Email.php',
828-
];
829-
$ignoreErrors[] = [
830-
'message' => '#^Method CodeIgniter\\\\Email\\\\Email\\:\\:batchBCCSend\\(\\) has no return type specified\\.$#',
831-
'count' => 1,
832-
'path' => __DIR__ . '/system/Email/Email.php',
833-
];
834-
$ignoreErrors[] = [
835-
'message' => '#^Method CodeIgniter\\\\Email\\\\Email\\:\\:buildHeaders\\(\\) has no return type specified\\.$#',
836-
'count' => 1,
837-
'path' => __DIR__ . '/system/Email/Email.php',
838-
];
839-
$ignoreErrors[] = [
840-
'message' => '#^Method CodeIgniter\\\\Email\\\\Email\\:\\:buildMessage\\(\\) has no return type specified\\.$#',
841-
'count' => 1,
842-
'path' => __DIR__ . '/system/Email/Email.php',
843-
];
844-
$ignoreErrors[] = [
845-
'message' => '#^Method CodeIgniter\\\\Email\\\\Email\\:\\:setErrorMessage\\(\\) has no return type specified\\.$#',
846-
'count' => 1,
847-
'path' => __DIR__ . '/system/Email/Email.php',
848-
];
849-
$ignoreErrors[] = [
850-
'message' => '#^Method CodeIgniter\\\\Email\\\\Email\\:\\:unwrapSpecials\\(\\) has no return type specified\\.$#',
851-
'count' => 1,
852-
'path' => __DIR__ . '/system/Email/Email.php',
853-
];
854-
$ignoreErrors[] = [
855-
'message' => '#^Method CodeIgniter\\\\Email\\\\Email\\:\\:writeHeaders\\(\\) has no return type specified\\.$#',
856-
'count' => 1,
857-
'path' => __DIR__ . '/system/Email/Email.php',
858-
];
859794
$ignoreErrors[] = [
860795
'message' => '#^Static property CodeIgniter\\\\Email\\\\Email\\:\\:\\$func_overload \\(bool\\) in isset\\(\\) is not nullable\\.$#',
861796
'count' => 1,
@@ -1031,36 +966,6 @@
1031966
'count' => 1,
1032967
'path' => __DIR__ . '/system/Filters/Filters.php',
1033968
];
1034-
$ignoreErrors[] = [
1035-
'message' => '#^Method CodeIgniter\\\\Filters\\\\Filters\\:\\:discoverFilters\\(\\) has no return type specified\\.$#',
1036-
'count' => 1,
1037-
'path' => __DIR__ . '/system/Filters/Filters.php',
1038-
];
1039-
$ignoreErrors[] = [
1040-
'message' => '#^Method CodeIgniter\\\\Filters\\\\Filters\\:\\:processAliasesToClass\\(\\) has no return type specified\\.$#',
1041-
'count' => 1,
1042-
'path' => __DIR__ . '/system/Filters/Filters.php',
1043-
];
1044-
$ignoreErrors[] = [
1045-
'message' => '#^Method CodeIgniter\\\\Filters\\\\Filters\\:\\:processFilters\\(\\) has no return type specified\\.$#',
1046-
'count' => 1,
1047-
'path' => __DIR__ . '/system/Filters/Filters.php',
1048-
];
1049-
$ignoreErrors[] = [
1050-
'message' => '#^Method CodeIgniter\\\\Filters\\\\Filters\\:\\:processGlobals\\(\\) has no return type specified\\.$#',
1051-
'count' => 1,
1052-
'path' => __DIR__ . '/system/Filters/Filters.php',
1053-
];
1054-
$ignoreErrors[] = [
1055-
'message' => '#^Method CodeIgniter\\\\Filters\\\\Filters\\:\\:processMethods\\(\\) has no return type specified\\.$#',
1056-
'count' => 1,
1057-
'path' => __DIR__ . '/system/Filters/Filters.php',
1058-
];
1059-
$ignoreErrors[] = [
1060-
'message' => '#^Method CodeIgniter\\\\Filters\\\\Filters\\:\\:setResponse\\(\\) has no return type specified\\.$#',
1061-
'count' => 1,
1062-
'path' => __DIR__ . '/system/Filters/Filters.php',
1063-
];
1064969
$ignoreErrors[] = [
1065970
'message' => '#^Method CodeIgniter\\\\Format\\\\XMLFormatter\\:\\:arrayToXML\\(\\) has no return type specified\\.$#',
1066971
'count' => 1,
@@ -1226,51 +1131,11 @@
12261131
'count' => 1,
12271132
'path' => __DIR__ . '/system/HTTP/UserAgent.php',
12281133
];
1229-
$ignoreErrors[] = [
1230-
'message' => '#^Function delete_cookie\\(\\) has no return type specified\\.$#',
1231-
'count' => 1,
1232-
'path' => __DIR__ . '/system/Helpers/cookie_helper.php',
1233-
];
1234-
$ignoreErrors[] = [
1235-
'message' => '#^Function set_cookie\\(\\) has no return type specified\\.$#',
1236-
'count' => 1,
1237-
'path' => __DIR__ . '/system/Helpers/cookie_helper.php',
1238-
];
12391134
$ignoreErrors[] = [
12401135
'message' => '#^Right side of && is always true\\.$#',
12411136
'count' => 1,
12421137
'path' => __DIR__ . '/system/Helpers/filesystem_helper.php',
12431138
];
1244-
$ignoreErrors[] = [
1245-
'message' => '#^Function d\\(\\) has no return type specified\\.$#',
1246-
'count' => 1,
1247-
'path' => __DIR__ . '/system/Helpers/kint_helper.php',
1248-
];
1249-
$ignoreErrors[] = [
1250-
'message' => '#^Function d\\(\\) has parameter \\$vars with no type specified\\.$#',
1251-
'count' => 1,
1252-
'path' => __DIR__ . '/system/Helpers/kint_helper.php',
1253-
];
1254-
$ignoreErrors[] = [
1255-
'message' => '#^Function dd\\(\\) has no return type specified\\.$#',
1256-
'count' => 2,
1257-
'path' => __DIR__ . '/system/Helpers/kint_helper.php',
1258-
];
1259-
$ignoreErrors[] = [
1260-
'message' => '#^Function dd\\(\\) has parameter \\$vars with no type specified\\.$#',
1261-
'count' => 1,
1262-
'path' => __DIR__ . '/system/Helpers/kint_helper.php',
1263-
];
1264-
$ignoreErrors[] = [
1265-
'message' => '#^Function trace\\(\\) has no return type specified\\.$#',
1266-
'count' => 2,
1267-
'path' => __DIR__ . '/system/Helpers/kint_helper.php',
1268-
];
1269-
$ignoreErrors[] = [
1270-
'message' => '#^Function mock\\(\\) has no return type specified\\.$#',
1271-
'count' => 1,
1272-
'path' => __DIR__ . '/system/Helpers/test_helper.php',
1273-
];
12741139
$ignoreErrors[] = [
12751140
'message' => '#^Method CodeIgniter\\\\Honeypot\\\\Exceptions\\\\HoneypotException\\:\\:forNoHiddenValue\\(\\) has no return type specified\\.$#',
12761141
'count' => 1,

system/Config/BaseConfig.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ protected function getEnvValue(string $property, string $prefix, string $shortPr
169169
* Provides external libraries a simple way to register one or more
170170
* options into a config file.
171171
*
172+
* @return void
173+
*
172174
* @throws ReflectionException
173175
*/
174176
protected function registerProperties()

system/Config/BaseService.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@ public static function serviceExists(string $name): ?string
275275

276276
/**
277277
* Reset shared instances and mocks for testing.
278+
*
279+
* @return void
278280
*/
279281
public static function reset(bool $initAutoloader = true)
280282
{
@@ -288,6 +290,8 @@ public static function reset(bool $initAutoloader = true)
288290

289291
/**
290292
* Resets any mock and shared instances for a single service.
293+
*
294+
* @return void
291295
*/
292296
public static function resetSingle(string $name)
293297
{
@@ -299,6 +303,8 @@ public static function resetSingle(string $name)
299303
* Inject mock object for testing.
300304
*
301305
* @param object $mock
306+
*
307+
* @return void
302308
*/
303309
public static function injectMock(string $name, $mock)
304310
{

system/Config/Config.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ public static function get(string $name, bool $getShared = true)
3434
* Helper method for injecting mock instances while testing.
3535
*
3636
* @param object $instance
37+
*
38+
* @return void
3739
*/
3840
public static function injectMock(string $name, $instance)
3941
{
@@ -42,6 +44,8 @@ public static function injectMock(string $name, $instance)
4244

4345
/**
4446
* Resets the static arrays
47+
*
48+
* @return void
4549
*/
4650
public static function reset()
4751
{

system/Config/DotEnv.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ public function parse(): ?array
8585
* Sets the variable into the environment. Will parse the string
8686
* first to look for {name}={value} pattern, ensure that nested
8787
* variables are handled, and strip it of single and double quotes.
88+
*
89+
* @return void
8890
*/
8991
protected function setVariable(string $name, string $value = '')
9092
{

system/Config/Factories.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,8 @@ public static function setOptions(string $component, array $values): array
374374
* Resets the static arrays, optionally just for one component
375375
*
376376
* @param string|null $component Lowercase, plural component name
377+
*
378+
* @return void
377379
*/
378380
public static function reset(?string $component = null)
379381
{
@@ -398,6 +400,8 @@ public static function reset(?string $component = null)
398400
* @param string $component Lowercase, plural component name
399401
* @param string $alias Class alias. See the $aliases property.
400402
*
403+
* @return void
404+
*
401405
* @internal For testing only
402406
* @testTag
403407
*/

system/Config/ForeignCharacters.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
class ForeignCharacters
1818
{
1919
/**
20-
* Without further ado, the list of foreign characters.
20+
* The list of foreign characters.
21+
*
22+
* @var array<string, string>
2123
*/
2224
public $characterList = [
2325
'/ä|æ|ǽ/' => 'ae',

0 commit comments

Comments
 (0)