Skip to content

Commit f491f66

Browse files
authored
Merge pull request #7750 from codeigniter4/develop
4.3.7 Ready code
2 parents 2834ef9 + 0d22b68 commit f491f66

File tree

514 files changed

+9725
-5320
lines changed

Some content is hidden

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

514 files changed

+9725
-5320
lines changed

.github/workflows/test-phpstan.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ on:
1212
- 'system/**.php'
1313
- 'utils/**.php'
1414
- composer.json
15-
- '**.neon.dist'
15+
- phpstan.neon.dist
16+
- phpstan-baseline.php
1617
- '.github/workflows/test-phpstan.yml'
1718

1819
push:
@@ -24,7 +25,8 @@ on:
2425
- 'system/**.php'
2526
- 'utils/**.php'
2627
- composer.json
27-
- '**.neon.dist'
28+
- phpstan.neon.dist
29+
- phpstan-baseline.php
2830
- '.github/workflows/test-phpstan.yml'
2931

3032
concurrency:

.github/workflows/test-rector.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ on:
1515
- '.github/workflows/test-rector.yml'
1616
- composer.json
1717
- rector.php
18+
- '**.neon.dist'
1819

1920
push:
2021
branches:
@@ -28,6 +29,7 @@ on:
2829
- '.github/workflows/test-rector.yml'
2930
- composer.json
3031
- rector.php
32+
- '**.neon.dist'
3133

3234
concurrency:
3335
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}

.php-cs-fixer.dist.php

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,45 @@
4343
__DIR__ . '/spark',
4444
]);
4545

46-
$overrides = [];
46+
$overrides = [
47+
'php_unit_data_provider_return_type' => true,
48+
'no_extra_blank_lines' => [
49+
'tokens' => [
50+
'attribute',
51+
'break',
52+
'case',
53+
'continue',
54+
'curly_brace_block',
55+
'default',
56+
'extra',
57+
'parenthesis_brace_block',
58+
'return',
59+
'square_brace_block',
60+
'switch',
61+
'throw',
62+
'use',
63+
],
64+
],
65+
];
4766

4867
$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-
],
68+
'cacheFile' => 'build/.php-cs-fixer.cache',
69+
'finder' => $finder,
5570
];
5671

57-
return Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary(
72+
$config = Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary(
5873
'CodeIgniter 4 framework',
5974
'CodeIgniter Foundation',
6075
6176
);
77+
78+
// @TODO: remove this check when support for PHP 7.4 is dropped
79+
if (PHP_VERSION_ID >= 80000) {
80+
$config
81+
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
82+
->setRules(array_merge($config->getRules(), [
83+
NoCodeSeparatorCommentFixer::name() => true,
84+
]));
85+
}
86+
87+
return $config;

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

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

32-
$overrides = [];
32+
$overrides = [
33+
'php_unit_data_provider_return_type' => true,
34+
'no_extra_blank_lines' => [
35+
'tokens' => [
36+
'attribute',
37+
'break',
38+
'case',
39+
'continue',
40+
'curly_brace_block',
41+
'default',
42+
'extra',
43+
'parenthesis_brace_block',
44+
'return',
45+
'square_brace_block',
46+
'switch',
47+
'throw',
48+
'use',
49+
],
50+
],
51+
];
3352

3453
$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-
],
54+
'cacheFile' => 'build/.php-cs-fixer.no-header.cache',
55+
'finder' => $finder,
4156
];
4257

43-
return Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();
58+
$config = Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();
59+
60+
// @TODO: remove this check when support for PHP 7.4 is dropped
61+
if (PHP_VERSION_ID >= 80000) {
62+
$config
63+
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
64+
->setRules(array_merge($config->getRules(), [
65+
NoCodeSeparatorCommentFixer::name() => true,
66+
]));
67+
}
68+
69+
return $config;

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

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,51 @@
2424
])
2525
->notPath([
2626
'ci3sample/',
27-
'libraries/sessions/016.php',
2827
'database/query_builder/075.php',
28+
'libraries/sessions/016.php',
29+
'outgoing/response/031.php',
30+
'outgoing/response/032.php',
2931
]);
3032

3133
$overrides = [
32-
'echo_tag_syntax' => false,
33-
'php_unit_internal_class' => false,
34-
'no_unused_imports' => false,
35-
'class_attributes_separation' => false,
34+
'echo_tag_syntax' => false,
35+
'php_unit_internal_class' => false,
36+
'no_unused_imports' => false,
37+
'class_attributes_separation' => false,
38+
'php_unit_data_provider_return_type' => true,
39+
'no_extra_blank_lines' => [
40+
'tokens' => [
41+
'attribute',
42+
'break',
43+
'case',
44+
'continue',
45+
'curly_brace_block',
46+
'default',
47+
'extra',
48+
'parenthesis_brace_block',
49+
'return',
50+
'square_brace_block',
51+
'switch',
52+
'throw',
53+
'use',
54+
],
55+
],
3656
];
3757

3858
$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-
],
59+
'cacheFile' => 'build/.php-cs-fixer.user-guide.cache',
60+
'finder' => $finder,
4561
];
4662

47-
return Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();
63+
$config = Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();
64+
65+
// @TODO: remove this check when support for PHP 7.4 is dropped
66+
if (PHP_VERSION_ID >= 80000) {
67+
$config
68+
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
69+
->setRules(array_merge($config->getRules(), [
70+
NoCodeSeparatorCommentFixer::name() => true,
71+
]));
72+
}
73+
74+
return $config;

CHANGELOG.md

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

3+
## [v4.3.7](https://github.com/codeigniter4/CodeIgniter4/tree/v4.3.7) (2023-07-30)
4+
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.3.6...v4.3.7)
5+
6+
### Breaking Changes
7+
8+
* fix: FeatureTestTrait may change $params values passed to call(), and a few bug fixes by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7602
9+
* fix: auto routing legacy and $route->add() by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7690
10+
* fix: [Model] setValidationRule() cannot use with ruleGroup by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7691
11+
12+
### Fixed Bugs
13+
14+
* docs: fix incorrect description on RedirectException (1) by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7629
15+
* docs: fix incorrect description on RedirectException (2) by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7633
16+
* fix: skip http proxy added header by @jozefrebjak in https://github.com/codeigniter4/CodeIgniter4/pull/7622
17+
* fix: number_to_roman() param type by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7640
18+
* fix: [Auto Routing Improved] feature testing may use incorrect param count by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7597
19+
* fix: `url_to()` error message by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7652
20+
* fix: [ViewCells] caching by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7663
21+
* fix: [ViewCells] when there are cells with the same short name, only the first cell is loaded by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7686
22+
* Fix number comparison in number_to_amount() in number_helper.php by @sba in https://github.com/codeigniter4/CodeIgniter4/pull/7701
23+
* fix: wrong Config classname to config() in Toolbar by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7735
24+
* fix: $sensitiveDataInTrace does not work by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7725
25+
26+
### Enhancements
27+
28+
* Remove PHPStan from pre-commit hook by @lonnieezell in https://github.com/codeigniter4/CodeIgniter4/pull/7618
29+
30+
### Refactoring
31+
32+
* refactor: remove unused property in Encryption\Handlers\BaseHandler by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7579
33+
* refactor: use ::class to config() param by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7611
34+
* refactor: remove unused non-empty array in RequestTrait by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7620
35+
* refactor: [Cache] simplify code of `FileHandler::getItem()` by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/7667
36+
* refactor: replace `config(Paths::class)` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7702
37+
338
## [v4.3.6](https://github.com/codeigniter4/CodeIgniter4/tree/v4.3.6) (2023-06-18)
439
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.3.5...v4.3.6)
540

admin/RELEASE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ the existing content.
8585
* Title: `4.x.x Ready code`
8686
* Description: blank
8787
* Merge the PR then create a new Release:
88-
* Version: `v4.x.x`
88+
* Tag: `v4.x.x` (Create new tag)
8989
* Target: `master`
9090
* Title: `CodeIgniter 4.x.x`
9191
* Description:
@@ -97,7 +97,7 @@ the existing content.
9797
## New Contributors
9898
*
9999

100-
Full Changelog: https://github.com/codeigniter4/CodeIgniter4/compare/v4.x.x...v4.x.x
100+
**Full Changelog**: https://github.com/codeigniter4/CodeIgniter4/compare/v4.x.x...v4.x.x
101101
```
102102
* Watch for the "Deploy Distributable Repos" action to make sure **framework**,
103103
**appstarter**, and **userguide** get updated

admin/pre-commit

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,6 @@ if [ "$STAGED_PHP_FILES" != "" ]; then
2020
done
2121
fi
2222

23-
if [ "$FILES" != "" ]; then
24-
echo "Running PHPStan..."
25-
26-
# Run on whole codebase
27-
if [ -d /proc/cygdrive ]; then
28-
XDEBUG_MODE=off ./vendor/bin/phpstan analyse
29-
else
30-
XDEBUG_MODE=off php ./vendor/bin/phpstan analyse
31-
fi
32-
33-
if [ $? != 0 ]; then
34-
echo "Fix the phpstan error(s) before commit."
35-
exit 1
36-
fi
37-
fi
38-
3923
if [ "$FILES" != "" ]; then
4024
echo "Running PHP CS Fixer..."
4125

app/Config/App.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class App extends BaseConfig
126126

127127
/**
128128
* --------------------------------------------------------------------------
129-
* URI PROTOCOL
129+
* Force Global Secure Requests
130130
* --------------------------------------------------------------------------
131131
*
132132
* If true, this will force every request made to this application to be

app/Config/Autoload.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
* can find the files as needed.
1414
*
1515
* NOTE: If you use an identical key in $psr4 or $classmap, then
16-
* the values in this file will overwrite the framework's values.
16+
* the values in this file will overwrite the framework's values.
17+
*
18+
* NOTE: This class is required prior to Autoloader instantiation,
19+
* and does not extend BaseConfig.
1720
*/
1821
class Autoload extends AutoloadConfig
1922
{

app/Config/Cache.php

Lines changed: 10 additions & 7 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;
@@ -53,12 +54,12 @@ class Cache extends BaseConfig
5354
* Whether to take the URL query string into consideration when generating
5455
* output cache files. Valid options are:
5556
*
56-
* false = Disabled
57-
* true = Enabled, take all query parameters into account.
58-
* Please be aware that this may result in numerous cache
59-
* files generated for the same page over and over again.
60-
* array('q') = Enabled, but only take into account the specified list
61-
* of query parameters.
57+
* false = Disabled
58+
* true = Enabled, take all query parameters into account.
59+
* Please be aware that this may result in numerous cache
60+
* files generated for the same page over and over again.
61+
* ['q'] = Enabled, but only take into account the specified list
62+
* of query parameters.
6263
*
6364
* @var bool|string[]
6465
*/
@@ -95,7 +96,8 @@ class Cache extends BaseConfig
9596
* A string of reserved characters that will not be allowed in keys or tags.
9697
* Strings that violate this restriction will cause handlers to throw.
9798
* Default: {}()/\@:
98-
* Note: The default set is required for PSR-6 compliance.
99+
*
100+
* NOTE: The default set is required for PSR-6 compliance.
99101
*/
100102
public string $reservedCharacters = '{}()/\@:';
101103

@@ -157,6 +159,7 @@ class Cache extends BaseConfig
157159
* that are listed here are allowed to be used.
158160
*
159161
* @var array<string, string>
162+
* @phpstan-var array<string, class-string<CacheInterface>>
160163
*/
161164
public array $validHandlers = [
162165
'dummy' => DummyHandler::class,

app/Config/ContentSecurityPolicy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class ContentSecurityPolicy extends BaseConfig
3939

4040
// -------------------------------------------------------------------------
4141
// Sources allowed
42-
// Note: once you set a policy to 'none', it cannot be further restricted
42+
// NOTE: once you set a policy to 'none', it cannot be further restricted
4343
// -------------------------------------------------------------------------
4444

4545
/**

app/Config/Filters.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class Filters extends BaseConfig
4949
*
5050
* If you use this, you should disable auto-routing because auto-routing
5151
* permits any HTTP method to access a controller. Accessing the controller
52-
* with a method you dont expect could bypass the filter.
52+
* with a method you don't expect could bypass the filter.
5353
*/
5454
public array $methods = [];
5555

0 commit comments

Comments
 (0)