Skip to content

Commit 93398b4

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.4
Conflicts: phpstan-baseline.neon.dist tests/system/Router/RouteCollectionReverseRouteTest.php
2 parents fcdf5da + a20df27 commit 93398b4

58 files changed

Lines changed: 3103 additions & 436 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: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,28 @@
4343
__DIR__ . '/spark',
4444
]);
4545

46-
$overrides = [];
46+
$overrides = [
47+
'php_unit_data_provider_return_type' => true,
48+
];
4749

4850
$options = [
49-
'cacheFile' => 'build/.php-cs-fixer.cache',
50-
'finder' => $finder,
51-
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
52-
'customRules' => [
53-
NoCodeSeparatorCommentFixer::name() => true,
54-
],
51+
'cacheFile' => 'build/.php-cs-fixer.cache',
52+
'finder' => $finder,
5553
];
5654

57-
return Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary(
55+
$config = Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary(
5856
'CodeIgniter 4 framework',
5957
'CodeIgniter Foundation',
6058
'admin@codeigniter.com'
6159
);
60+
61+
// @TODO: remove this check when support for PHP 7.4 is dropped
62+
if (PHP_VERSION_ID >= 80000) {
63+
$config
64+
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
65+
->setRules(array_merge($config->getRules(), [
66+
NoCodeSeparatorCommentFixer::name() => true,
67+
]));
68+
}
69+
70+
return $config;

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

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,24 @@
2929
__DIR__ . '/admin/starter/builds',
3030
]);
3131

32-
$overrides = [];
32+
$overrides = [
33+
'php_unit_data_provider_return_type' => true,
34+
];
3335

3436
$options = [
35-
'cacheFile' => 'build/.php-cs-fixer.no-header.cache',
36-
'finder' => $finder,
37-
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
38-
'customRules' => [
39-
NoCodeSeparatorCommentFixer::name() => true,
40-
],
37+
'cacheFile' => 'build/.php-cs-fixer.no-header.cache',
38+
'finder' => $finder,
4139
];
4240

43-
return Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();
41+
$config = Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();
42+
43+
// @TODO: remove this check when support for PHP 7.4 is dropped
44+
if (PHP_VERSION_ID >= 80000) {
45+
$config
46+
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
47+
->setRules(array_merge($config->getRules(), [
48+
NoCodeSeparatorCommentFixer::name() => true,
49+
]));
50+
}
51+
52+
return $config;

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

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,27 @@
2929
]);
3030

3131
$overrides = [
32-
'echo_tag_syntax' => false,
33-
'php_unit_internal_class' => false,
34-
'no_unused_imports' => false,
35-
'class_attributes_separation' => false,
32+
'echo_tag_syntax' => false,
33+
'php_unit_internal_class' => false,
34+
'no_unused_imports' => false,
35+
'class_attributes_separation' => false,
36+
'php_unit_data_provider_return_type' => true,
3637
];
3738

3839
$options = [
39-
'cacheFile' => 'build/.php-cs-fixer.user-guide.cache',
40-
'finder' => $finder,
41-
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
42-
'customRules' => [
43-
NoCodeSeparatorCommentFixer::name() => true,
44-
],
40+
'cacheFile' => 'build/.php-cs-fixer.no-header.cache',
41+
'finder' => $finder,
4542
];
4643

47-
return Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();
44+
$config = Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();
45+
46+
// @TODO: remove this check when support for PHP 7.4 is dropped
47+
if (PHP_VERSION_ID >= 80000) {
48+
$config
49+
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
50+
->setRules(array_merge($config->getRules(), [
51+
NoCodeSeparatorCommentFixer::name() => true,
52+
]));
53+
}
54+
55+
return $config;

app/Config/Cache.php

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

33
namespace Config;
44

5+
use CodeIgniter\Cache\CacheInterface;
56
use CodeIgniter\Cache\Handlers\DummyHandler;
67
use CodeIgniter\Cache\Handlers\FileHandler;
78
use CodeIgniter\Cache\Handlers\MemcachedHandler;
@@ -158,6 +159,7 @@ class Cache extends BaseConfig
158159
* that are listed here are allowed to be used.
159160
*
160161
* @var array<string, string>
162+
* @phpstan-var array<string, class-string<CacheInterface>>
161163
*/
162164
public array $validHandlers = [
163165
'dummy' => DummyHandler::class,

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"nexusphp/cs-config": "^3.6",
2121
"nexusphp/tachycardia": "^1.0",
2222
"php-coveralls/php-coveralls": "^2.5",
23-
"phpstan/phpstan": "^1.7.1",
23+
"phpstan/phpstan": "^1.10.2",
2424
"phpunit/phpcov": "^8.2",
2525
"phpunit/phpunit": "^9.1",
2626
"predis/predis": "^1.1 || ^2.0",

phpstan-baseline.neon.dist

Lines changed: 0 additions & 256 deletions
This file was deleted.

0 commit comments

Comments
 (0)