Skip to content

Commit cc14fdd

Browse files
authored
Merge pull request #7118 from codeigniter4/develop
4.3.1 Ready code
2 parents f8e4ec5 + 68e138f commit cc14fdd

Some content is hidden

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

59 files changed

+468
-355
lines changed

CHANGELOG.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## [v4.3.1](https://github.com/codeigniter4/CodeIgniter4/tree/v4.3.1) (2023-01-14)
4+
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.3.0...v4.3.1)
5+
6+
### Fixed Bugs
7+
8+
* fix: Email config in the .env doesn't appear as expected by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7078
9+
* fix: TypeError in Validation is_unique/is_not_unique by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7085
10+
* fix: revert method name resetQuery() changed accidentally by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7083
11+
* fix: handling float in Validation Strcit Rules (greater_than, greater_than_equal_to, less_than, less_than_equal_to) by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7098
12+
* docs: add missing instruction for Config/Exceptions in PHP 8.2 by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7100
13+
* fix: Call to undefined method Composer\InstalledVersions::getAllRawData() error by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7107
14+
15+
### Refactoring
16+
17+
* [Rector] Enable AddDefaultValueForUndefinedVariableRector by @samsonasik in https://github.com/codeigniter4/CodeIgniter4/pull/7088
18+
319
## [v4.3.0](https://github.com/codeigniter4/CodeIgniter4/tree/v4.3.0) (2023-01-10)
420
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.2.12...v4.3.0)
521

@@ -12,7 +28,6 @@
1228
* fix: exceptionHandler may return invalid HTTP status code by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6228
1329
* feat: add Form helpers for Validation Errors by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6384
1430
* fix: ValidationInterface by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6253
15-
* [Reverted] Make Unique Index Name Unique by @sclubricants in https://github.com/codeigniter4/CodeIgniter4/pull/6516
1631
* fix: types in database classes by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6527
1732
* fix: ResponseInterface (1) by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6556
1833
* Improve BaseConnection::getForeignKeyData() and Forge::addForeignKey() by @sclubricants in https://github.com/codeigniter4/CodeIgniter4/pull/6468

admin/RELEASE.md

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,17 @@
22

33
> Documentation guide based on the releases of `4.0.5` and `4.1.0` on January 31, 2021.
44
>
5-
> Updated for `4.2.10` on November 5, 2022.
5+
> Updated for `4.3.0` on January 10, 2023.
66
>
7-
> -MGatner
7+
> -MGatner, kenjis
8+
9+
## [Minor version only] Merge minor version branch into develop
10+
11+
If you release a new minor version.
12+
13+
* Create PR to merge `4.x` into `develop` and merge it
14+
* Delete the merged `4.x` branch (This closes all PRs to the branch)
15+
* Do the regular release process. Go to the next "Changelog" section
816

917
## Changelog
1018

@@ -17,7 +25,20 @@ When generating the changelog each Pull Request to be included must have one of
1725
PRs with breaking changes must have the following additional label:
1826
- **breaking change** ... PRs that may break existing functionalities
1927

20-
To auto-generate, start drafting a new Release and use the "Generate release notes" button.
28+
### Generate Changelog
29+
30+
To auto-generate, navigate to the [Releases](https://github.com/codeigniter4/CodeIgniter4/releases) page,
31+
click the "Draft a new release" button.
32+
33+
* Tag: "v4.x.x" (Create new tag)
34+
* Target: develop
35+
36+
Click the "Generate release notes" button.
37+
38+
Check the resulting content. If there are items in the *Others* section which
39+
should be included in the changelog, add a label to the PR and regenerate
40+
the changelog.
41+
2142
Copy the resulting content into **CHANGELOG.md** and adjust the format to match the existing content.
2243

2344
## Preparation
@@ -73,9 +94,9 @@ cd release-test
7394
composer test && composer info codeigniter4/framework
7495
```
7596
* Verify that the user guide actions succeeded:
76-
* "Deploy Distributable Repos", framework repo
77-
* "Deploy Production", UG repo
78-
* "pages-build-deployment", UG repo
97+
* "[Deploy Distributable Repos](https://github.com/codeigniter4/CodeIgniter4/actions/workflows/deploy-distributables.yml)", the main repo
98+
* "[Deploy Production](https://github.com/codeigniter4/userguide/actions/workflows/deploy.yml)", UG repo
99+
* "[pages-build-deployment](https://github.com/codeigniter4/userguide/actions/workflows/pages/pages-build-deployment)", UG repo
79100
* Fast-forward `develop` branch to catch the merge commit from `master`
80101
```console
81102
git fetch origin
@@ -92,6 +113,13 @@ git merge origin/4.x
92113
git merge origin/develop
93114
git push origin HEAD
94115
```
116+
* [Minor version only] Create the next minor upgrade branch `4.x`:
117+
```console
118+
git fetch origin
119+
git switch develop
120+
git switch -c 4.x
121+
git push origin HEAD
122+
```
95123
* Publish any Security Advisories that were resolved from private forks
96124
* Announce the release on the forums and Slack channel (note: this forum is restricted to administrators):
97125
* Make a new topic in the "News & Discussion" forums: https://forum.codeigniter.com/forum-2.html

admin/next-changelog-minor.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,6 @@ Deprecations
7171
Bugs Fixed
7272
**********
7373

74-
See the repo's `CHANGELOG.md <https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHANGELOG.md>`_ for a complete list of bugs fixed.
74+
See the repo's
75+
`CHANGELOG.md <https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHANGELOG.md>`_
76+
for a complete list of bugs fixed.

admin/next-changelog-patch.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ Release Date: Unreleased
1212
BREAKING
1313
********
1414

15-
Enhancements
16-
************
17-
1815
Message Changes
1916
***************
2017

@@ -27,4 +24,6 @@ Deprecations
2724
Bugs Fixed
2825
**********
2926

30-
See the repo's `CHANGELOG.md <https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHANGELOG.md>`_ for a complete list of bugs fixed.
27+
See the repo's
28+
`CHANGELOG.md <https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHANGELOG.md>`_
29+
for a complete list of bugs fixed.

app/Config/Email.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
class Email extends BaseConfig
88
{
9-
public string $fromEmail;
10-
public string $fromName;
11-
public string $recipients;
9+
public string $fromEmail = '';
10+
public string $fromName = '';
11+
public string $recipients = '';
1212

1313
/**
1414
* The "user agent"
@@ -28,17 +28,17 @@ class Email extends BaseConfig
2828
/**
2929
* SMTP Server Address
3030
*/
31-
public string $SMTPHost;
31+
public string $SMTPHost = '';
3232

3333
/**
3434
* SMTP Username
3535
*/
36-
public string $SMTPUser;
36+
public string $SMTPUser = '';
3737

3838
/**
3939
* SMTP Password
4040
*/
41-
public string $SMTPPass;
41+
public string $SMTPPass = '';
4242

4343
/**
4444
* SMTP Port

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"phpunit/phpcov": "^8.2",
2626
"phpunit/phpunit": "^9.1",
2727
"predis/predis": "^1.1 || ^2.0",
28-
"rector/rector": "0.15.2",
28+
"rector/rector": "0.15.5",
2929
"vimeo/psalm": "^5.0"
3030
},
3131
"suggest": {

phpstan-baseline.neon.dist

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ parameters:
2525
count: 1
2626
path: system/Cache/Handlers/MemcachedHandler.php
2727

28-
-
29-
message: "#^Variable \\$data might not be defined\\.$#"
30-
count: 1
31-
path: system/Cache/Handlers/MemcachedHandler.php
32-
3328
-
3429
message: "#^Property CodeIgniter\\\\Cache\\\\Handlers\\\\RedisHandler\\:\\:\\$redis \\(Redis\\) in isset\\(\\) is not nullable\\.$#"
3530
count: 1
@@ -200,11 +195,6 @@ parameters:
200195
count: 1
201196
path: system/Helpers/number_helper.php
202197

203-
-
204-
message: "#^Variable \\$count might not be defined\\.$#"
205-
count: 1
206-
path: system/Helpers/url_helper.php
207-
208198
-
209199
message: "#^Property CodeIgniter\\\\Images\\\\Handlers\\\\BaseHandler\\:\\:\\$image \\(CodeIgniter\\\\Images\\\\Image\\) in empty\\(\\) is not falsy\\.$#"
210200
count: 1
@@ -230,21 +220,6 @@ parameters:
230220
count: 4
231221
path: system/Images/Handlers/ImageMagickHandler.php
232222

233-
-
234-
message: "#^Variable \\$gravity might not be defined\\.$#"
235-
count: 1
236-
path: system/Images/Handlers/ImageMagickHandler.php
237-
238-
-
239-
message: "#^Variable \\$xAxis might not be defined\\.$#"
240-
count: 1
241-
path: system/Images/Handlers/ImageMagickHandler.php
242-
243-
-
244-
message: "#^Variable \\$yAxis might not be defined\\.$#"
245-
count: 1
246-
path: system/Images/Handlers/ImageMagickHandler.php
247-
248223
-
249224
message: "#^Call to an undefined method CodeIgniter\\\\Router\\\\RouteCollectionInterface\\:\\:getDefaultNamespace\\(\\)\\.$#"
250225
count: 3

rector.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
use Rector\EarlyReturn\Rector\If_\RemoveAlwaysElseRector;
3737
use Rector\EarlyReturn\Rector\Return_\PreparedValueToEarlyReturnRector;
3838
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
39-
use Rector\Php56\Rector\FunctionLike\AddDefaultValueForUndefinedVariableRector;
4039
use Rector\Php70\Rector\FuncCall\RandomFunctionRector;
4140
use Rector\Php71\Rector\FuncCall\CountOnNullRector;
4241
use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector;
@@ -106,9 +105,6 @@
106105
// sometime too detail
107106
CountOnNullRector::class,
108107

109-
// may not be unitialized on purpose
110-
AddDefaultValueForUndefinedVariableRector::class,
111-
112108
// use mt_rand instead of random_int on purpose on non-cryptographically random
113109
RandomFunctionRector::class,
114110

system/Autoloader/Autoloader.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,14 @@ private function loadComposerNamespaces(ClassLoader $composer, array $composerPa
373373
unset($namespacePaths['CodeIgniter\\']);
374374
}
375375

376+
if (! method_exists(InstalledVersions::class, 'getAllRawData')) {
377+
throw new RuntimeException(
378+
'Your Composer version is too old.'
379+
. ' Please update Composer (run `composer self-update`) to v2.0.14 or later'
380+
. ' and remove your vendor/ directory, and run `composer update`.'
381+
);
382+
}
383+
// This method requires Composer 2.0.14 or later.
376384
$packageList = InstalledVersions::getAllRawData()[0]['versions'];
377385

378386
// Check config for $composerPackages.

system/Cache/Handlers/MemcachedHandler.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ public function initialize()
124124
*/
125125
public function get(string $key)
126126
{
127-
$key = static::validateKey($key, $this->prefix);
127+
$data = [];
128+
$key = static::validateKey($key, $this->prefix);
128129

129130
if ($this->memcached instanceof Memcached) {
130131
$data = $this->memcached->get($key);

0 commit comments

Comments
 (0)