Skip to content

Commit

Permalink
Merge pull request codeigniter4#7750 from codeigniter4/develop
Browse files Browse the repository at this point in the history
4.3.7 Ready code
  • Loading branch information
kenjis authored Jul 30, 2023
2 parents 2834ef9 + 0d22b68 commit f491f66
Show file tree
Hide file tree
Showing 514 changed files with 9,725 additions and 5,320 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/test-phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ on:
- 'system/**.php'
- 'utils/**.php'
- composer.json
- '**.neon.dist'
- phpstan.neon.dist
- phpstan-baseline.php
- '.github/workflows/test-phpstan.yml'

push:
Expand All @@ -24,7 +25,8 @@ on:
- 'system/**.php'
- 'utils/**.php'
- composer.json
- '**.neon.dist'
- phpstan.neon.dist
- phpstan-baseline.php
- '.github/workflows/test-phpstan.yml'

concurrency:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test-rector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:
- '.github/workflows/test-rector.yml'
- composer.json
- rector.php
- '**.neon.dist'

push:
branches:
Expand All @@ -28,6 +29,7 @@ on:
- '.github/workflows/test-rector.yml'
- composer.json
- rector.php
- '**.neon.dist'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
42 changes: 34 additions & 8 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,45 @@
__DIR__ . '/spark',
]);

$overrides = [];
$overrides = [
'php_unit_data_provider_return_type' => true,
'no_extra_blank_lines' => [
'tokens' => [
'attribute',
'break',
'case',
'continue',
'curly_brace_block',
'default',
'extra',
'parenthesis_brace_block',
'return',
'square_brace_block',
'switch',
'throw',
'use',
],
],
];

$options = [
'cacheFile' => 'build/.php-cs-fixer.cache',
'finder' => $finder,
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
'customRules' => [
NoCodeSeparatorCommentFixer::name() => true,
],
'cacheFile' => 'build/.php-cs-fixer.cache',
'finder' => $finder,
];

return Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary(
$config = Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary(
'CodeIgniter 4 framework',
'CodeIgniter Foundation',
'[email protected]'
);

// @TODO: remove this check when support for PHP 7.4 is dropped
if (PHP_VERSION_ID >= 80000) {
$config
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
->setRules(array_merge($config->getRules(), [
NoCodeSeparatorCommentFixer::name() => true,
]));
}

return $config;
42 changes: 34 additions & 8 deletions .php-cs-fixer.no-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,41 @@
__DIR__ . '/admin/starter/builds',
]);

$overrides = [];
$overrides = [
'php_unit_data_provider_return_type' => true,
'no_extra_blank_lines' => [
'tokens' => [
'attribute',
'break',
'case',
'continue',
'curly_brace_block',
'default',
'extra',
'parenthesis_brace_block',
'return',
'square_brace_block',
'switch',
'throw',
'use',
],
],
];

$options = [
'cacheFile' => 'build/.php-cs-fixer.no-header.cache',
'finder' => $finder,
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
'customRules' => [
NoCodeSeparatorCommentFixer::name() => true,
],
'cacheFile' => 'build/.php-cs-fixer.no-header.cache',
'finder' => $finder,
];

return Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();
$config = Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();

// @TODO: remove this check when support for PHP 7.4 is dropped
if (PHP_VERSION_ID >= 80000) {
$config
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
->setRules(array_merge($config->getRules(), [
NoCodeSeparatorCommentFixer::name() => true,
]));
}

return $config;
51 changes: 39 additions & 12 deletions .php-cs-fixer.user-guide.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,51 @@
])
->notPath([
'ci3sample/',
'libraries/sessions/016.php',
'database/query_builder/075.php',
'libraries/sessions/016.php',
'outgoing/response/031.php',
'outgoing/response/032.php',
]);

$overrides = [
'echo_tag_syntax' => false,
'php_unit_internal_class' => false,
'no_unused_imports' => false,
'class_attributes_separation' => false,
'echo_tag_syntax' => false,
'php_unit_internal_class' => false,
'no_unused_imports' => false,
'class_attributes_separation' => false,
'php_unit_data_provider_return_type' => true,
'no_extra_blank_lines' => [
'tokens' => [
'attribute',
'break',
'case',
'continue',
'curly_brace_block',
'default',
'extra',
'parenthesis_brace_block',
'return',
'square_brace_block',
'switch',
'throw',
'use',
],
],
];

$options = [
'cacheFile' => 'build/.php-cs-fixer.user-guide.cache',
'finder' => $finder,
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
'customRules' => [
NoCodeSeparatorCommentFixer::name() => true,
],
'cacheFile' => 'build/.php-cs-fixer.user-guide.cache',
'finder' => $finder,
];

return Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();
$config = Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();

// @TODO: remove this check when support for PHP 7.4 is dropped
if (PHP_VERSION_ID >= 80000) {
$config
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
->setRules(array_merge($config->getRules(), [
NoCodeSeparatorCommentFixer::name() => true,
]));
}

return $config;
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
# Changelog

## [v4.3.7](https://github.com/codeigniter4/CodeIgniter4/tree/v4.3.7) (2023-07-30)
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.3.6...v4.3.7)

### Breaking Changes

* fix: FeatureTestTrait may change $params values passed to call(), and a few bug fixes by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7602
* fix: auto routing legacy and $route->add() by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7690
* fix: [Model] setValidationRule() cannot use with ruleGroup by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7691

### Fixed Bugs

* docs: fix incorrect description on RedirectException (1) by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7629
* docs: fix incorrect description on RedirectException (2) by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7633
* fix: skip http proxy added header by @jozefrebjak in https://github.com/codeigniter4/CodeIgniter4/pull/7622
* fix: number_to_roman() param type by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7640
* fix: [Auto Routing Improved] feature testing may use incorrect param count by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7597
* fix: `url_to()` error message by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7652
* fix: [ViewCells] caching by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7663
* 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
* Fix number comparison in number_to_amount() in number_helper.php by @sba in https://github.com/codeigniter4/CodeIgniter4/pull/7701
* fix: wrong Config classname to config() in Toolbar by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7735
* fix: $sensitiveDataInTrace does not work by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7725

### Enhancements

* Remove PHPStan from pre-commit hook by @lonnieezell in https://github.com/codeigniter4/CodeIgniter4/pull/7618

### Refactoring

* refactor: remove unused property in Encryption\Handlers\BaseHandler by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7579
* refactor: use ::class to config() param by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7611
* refactor: remove unused non-empty array in RequestTrait by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7620
* refactor: [Cache] simplify code of `FileHandler::getItem()` by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/7667
* refactor: replace `config(Paths::class)` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7702

## [v4.3.6](https://github.com/codeigniter4/CodeIgniter4/tree/v4.3.6) (2023-06-18)
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.3.5...v4.3.6)

Expand Down
4 changes: 2 additions & 2 deletions admin/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ the existing content.
* Title: `4.x.x Ready code`
* Description: blank
* Merge the PR then create a new Release:
* Version: `v4.x.x`
* Tag: `v4.x.x` (Create new tag)
* Target: `master`
* Title: `CodeIgniter 4.x.x`
* Description:
Expand All @@ -97,7 +97,7 @@ the existing content.
## New Contributors
*

Full Changelog: https://github.com/codeigniter4/CodeIgniter4/compare/v4.x.x...v4.x.x
**Full Changelog**: https://github.com/codeigniter4/CodeIgniter4/compare/v4.x.x...v4.x.x
```
* Watch for the "Deploy Distributable Repos" action to make sure **framework**,
**appstarter**, and **userguide** get updated
Expand Down
16 changes: 0 additions & 16 deletions admin/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,6 @@ if [ "$STAGED_PHP_FILES" != "" ]; then
done
fi

if [ "$FILES" != "" ]; then
echo "Running PHPStan..."

# Run on whole codebase
if [ -d /proc/cygdrive ]; then
XDEBUG_MODE=off ./vendor/bin/phpstan analyse
else
XDEBUG_MODE=off php ./vendor/bin/phpstan analyse
fi

if [ $? != 0 ]; then
echo "Fix the phpstan error(s) before commit."
exit 1
fi
fi

if [ "$FILES" != "" ]; then
echo "Running PHP CS Fixer..."

Expand Down
2 changes: 1 addition & 1 deletion app/Config/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class App extends BaseConfig

/**
* --------------------------------------------------------------------------
* URI PROTOCOL
* Force Global Secure Requests
* --------------------------------------------------------------------------
*
* If true, this will force every request made to this application to be
Expand Down
5 changes: 4 additions & 1 deletion app/Config/Autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
* can find the files as needed.
*
* NOTE: If you use an identical key in $psr4 or $classmap, then
* the values in this file will overwrite the framework's values.
* the values in this file will overwrite the framework's values.
*
* NOTE: This class is required prior to Autoloader instantiation,
* and does not extend BaseConfig.
*/
class Autoload extends AutoloadConfig
{
Expand Down
17 changes: 10 additions & 7 deletions app/Config/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Config;

use CodeIgniter\Cache\CacheInterface;
use CodeIgniter\Cache\Handlers\DummyHandler;
use CodeIgniter\Cache\Handlers\FileHandler;
use CodeIgniter\Cache\Handlers\MemcachedHandler;
Expand Down Expand Up @@ -53,12 +54,12 @@ class Cache extends BaseConfig
* Whether to take the URL query string into consideration when generating
* output cache files. Valid options are:
*
* false = Disabled
* true = Enabled, take all query parameters into account.
* Please be aware that this may result in numerous cache
* files generated for the same page over and over again.
* array('q') = Enabled, but only take into account the specified list
* of query parameters.
* false = Disabled
* true = Enabled, take all query parameters into account.
* Please be aware that this may result in numerous cache
* files generated for the same page over and over again.
* ['q'] = Enabled, but only take into account the specified list
* of query parameters.
*
* @var bool|string[]
*/
Expand Down Expand Up @@ -95,7 +96,8 @@ class Cache extends BaseConfig
* A string of reserved characters that will not be allowed in keys or tags.
* Strings that violate this restriction will cause handlers to throw.
* Default: {}()/\@:
* Note: The default set is required for PSR-6 compliance.
*
* NOTE: The default set is required for PSR-6 compliance.
*/
public string $reservedCharacters = '{}()/\@:';

Expand Down Expand Up @@ -157,6 +159,7 @@ class Cache extends BaseConfig
* that are listed here are allowed to be used.
*
* @var array<string, string>
* @phpstan-var array<string, class-string<CacheInterface>>
*/
public array $validHandlers = [
'dummy' => DummyHandler::class,
Expand Down
2 changes: 1 addition & 1 deletion app/Config/ContentSecurityPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ContentSecurityPolicy extends BaseConfig

// -------------------------------------------------------------------------
// Sources allowed
// Note: once you set a policy to 'none', it cannot be further restricted
// NOTE: once you set a policy to 'none', it cannot be further restricted
// -------------------------------------------------------------------------

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Config/Filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Filters extends BaseConfig
*
* If you use this, you should disable auto-routing because auto-routing
* permits any HTTP method to access a controller. Accessing the controller
* with a method you dont expect could bypass the filter.
* with a method you don't expect could bypass the filter.
*/
public array $methods = [];

Expand Down
Loading

0 comments on commit f491f66

Please sign in to comment.