From 3dfd4bcb4c9ba326733ced3ff737e0e5e876fc2a Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 6 Sep 2024 13:53:08 +0900 Subject: [PATCH 01/13] docs: fix param types --- user_guide_src/source/helpers/url_helper.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/user_guide_src/source/helpers/url_helper.rst b/user_guide_src/source/helpers/url_helper.rst index 9278539b3aea..6d136855ea47 100644 --- a/user_guide_src/source/helpers/url_helper.rst +++ b/user_guide_src/source/helpers/url_helper.rst @@ -124,7 +124,7 @@ The following functions are available: :param boolean $returnObject: True if you would like a URI instance returned instead of a string. :returns: The URL the user was previously on - :rtype: string|mixed|\\CodeIgniter\\HTTP\\URI + :rtype: string|\\CodeIgniter\\HTTP\\URI Returns the full URL (including segments) of the page the user was previously on. @@ -182,10 +182,10 @@ The following functions are available: .. php:function:: anchor([$uri = ''[, $title = ''[, $attributes = ''[, $altConfig = null]]]]) - :param mixed $uri: URI string or array of URI segments - :param string $title: Anchor title - :param mixed $attributes: HTML attributes - :param \\Config\\App $altConfig: Alternate configuration to use + :param array|string $uri: URI string or array of URI segments + :param string $title: Anchor title + :param array|object|string $attributes: HTML attributes + :param \\Config\\App|null $altConfig: Alternate configuration to use :returns: HTML hyperlink (anchor tag) :rtype: string @@ -222,7 +222,7 @@ The following functions are available: :param string $uri: URI string :param string $title: Anchor title - :param mixed $attributes: HTML attributes + :param array|false|object|string $attributes: HTML attributes :param \\Config\\App $altConfig: Alternate configuration to use :returns: Pop-up hyperlink :rtype: string @@ -262,7 +262,7 @@ The following functions are available: :param string $email: E-mail address :param string $title: Anchor title - :param mixed $attributes: HTML attributes + :param array|object|string $attributes: HTML attributes :returns: A "mail to" hyperlink :rtype: string @@ -281,7 +281,7 @@ The following functions are available: :param string $email: E-mail address :param string $title: Anchor title - :param mixed $attributes: HTML attributes + :param array|object|string $attributes: HTML attributes :returns: A spam-safe "mail to" hyperlink :rtype: string @@ -378,7 +378,7 @@ The following functions are available: .. php:function:: url_to($controller[, ...$args]) :param string $controller: Route name or Controller::method - :param mixed ...$args: One or more parameters to be passed to the route. The last parameter allows you to set the locale. + :param int|string ...$args: One or more parameters to be passed to the route. The last parameter allows you to set the locale. :returns: Absolute URL :rtype: string From 2ef57abe351b9c1488290e944046c86d6ba38bdf Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 6 Sep 2024 13:53:24 +0900 Subject: [PATCH 02/13] docs: decorate text --- user_guide_src/source/helpers/url_helper.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/user_guide_src/source/helpers/url_helper.rst b/user_guide_src/source/helpers/url_helper.rst index 6d136855ea47..44e52dd0d8a3 100644 --- a/user_guide_src/source/helpers/url_helper.rst +++ b/user_guide_src/source/helpers/url_helper.rst @@ -21,7 +21,7 @@ The following functions are available: .. php:function:: site_url([$uri = ''[, $protocol = null[, $altConfig = null]]]) :param array|string $uri: URI string or array of URI segments. - :param string $protocol: Protocol, e.g., 'http' or 'https'. If empty string '' is set, a protocol-relative link is returned. + :param string $protocol: Protocol, e.g., ``'http'`` or ``'https'``. If empty string ``''`` is set, a protocol-relative link is returned. :param \\Config\\App $altConfig: Alternate configuration to use. :returns: Site URL :rtype: string @@ -57,7 +57,7 @@ The following functions are available: .. php:function:: base_url([$uri = ''[, $protocol = null]]) :param array|string $uri: URI string or array of URI segments. - :param string $protocol: Protocol, e.g., 'http' or 'https'. If empty string '' is set, a protocol-relative link is returned. + :param string $protocol: Protocol, e.g., ``'http'`` or ``'https'``. If empty string ``''`` is set, a protocol-relative link is returned. :returns: Base URL :rtype: string @@ -292,7 +292,7 @@ The following functions are available: .. php:function:: auto_link($str[, $type = 'both'[, $popup = false]]) :param string $str: Input string - :param string $type: Link type ('email', 'url' or 'both') + :param string $type: Link type (``'email'``, ``'url'`` or ``'both'``) :param bool $popup: Whether to create popup links :returns: Linkified string :rtype: string From b5b2e57fdf7e5a86220690cb5f0732fa506d75a0 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 7 Sep 2024 17:59:37 +0900 Subject: [PATCH 03/13] docs: add changelog and upgrade for v4.5.6 --- user_guide_src/source/changelogs/index.rst | 1 + user_guide_src/source/changelogs/v4.5.6.rst | 35 ++++++++++++ .../source/installation/upgrade_456.rst | 55 +++++++++++++++++++ .../source/installation/upgrading.rst | 1 + 4 files changed, 92 insertions(+) create mode 100644 user_guide_src/source/changelogs/v4.5.6.rst create mode 100644 user_guide_src/source/installation/upgrade_456.rst diff --git a/user_guide_src/source/changelogs/index.rst b/user_guide_src/source/changelogs/index.rst index 702a590e4fbb..a4d102ada233 100644 --- a/user_guide_src/source/changelogs/index.rst +++ b/user_guide_src/source/changelogs/index.rst @@ -12,6 +12,7 @@ See all the changes. .. toctree:: :titlesonly: + v4.5.6 v4.5.5 v4.5.4 v4.5.3 diff --git a/user_guide_src/source/changelogs/v4.5.6.rst b/user_guide_src/source/changelogs/v4.5.6.rst new file mode 100644 index 000000000000..33e3e5a1a0ab --- /dev/null +++ b/user_guide_src/source/changelogs/v4.5.6.rst @@ -0,0 +1,35 @@ +############# +Version 4.5.6 +############# + +Release Date: Unreleased + +**4.5.6 release of CodeIgniter4** + +.. contents:: + :local: + :depth: 3 + +******** +BREAKING +******** + +*************** +Message Changes +*************** + +******* +Changes +******* + +************ +Deprecations +************ + +********** +Bugs Fixed +********** + +See the repo's +`CHANGELOG.md `_ +for a complete list of bugs fixed. diff --git a/user_guide_src/source/installation/upgrade_456.rst b/user_guide_src/source/installation/upgrade_456.rst new file mode 100644 index 000000000000..d0764f3ff6ee --- /dev/null +++ b/user_guide_src/source/installation/upgrade_456.rst @@ -0,0 +1,55 @@ +############################# +Upgrading from 4.5.5 to 4.5.6 +############################# + +Please refer to the upgrade instructions corresponding to your installation method. + +- :ref:`Composer Installation App Starter Upgrading ` +- :ref:`Composer Installation Adding CodeIgniter4 to an Existing Project Upgrading ` +- :ref:`Manual Installation Upgrading ` + +.. contents:: + :local: + :depth: 2 + +********************** +Mandatory File Changes +********************** + +**************** +Breaking Changes +**************** + +********************* +Breaking Enhancements +********************* + +************* +Project Files +************* + +Some files in the **project space** (root, app, public, writable) received updates. Due to +these files being outside of the **system** scope they will not be changed without your intervention. + +.. note:: There are some third-party CodeIgniter modules available to assist + with merging changes to the project space: + `Explore on Packagist `_. + +Content Changes +=============== + +The following files received significant changes (including deprecations or visual adjustments) +and it is recommended that you merge the updated versions with your application: + +Config +------ + +- @TODO + +All Changes +=========== + +This is a list of all files in the **project space** that received changes; +many will be simple comments or formatting that have no effect on the runtime: + +- @TODO diff --git a/user_guide_src/source/installation/upgrading.rst b/user_guide_src/source/installation/upgrading.rst index 39f262288813..0b489abb9101 100644 --- a/user_guide_src/source/installation/upgrading.rst +++ b/user_guide_src/source/installation/upgrading.rst @@ -16,6 +16,7 @@ See also :doc:`./backward_compatibility_notes`. backward_compatibility_notes + upgrade_456 upgrade_455 upgrade_454 upgrade_453 From ee9ae5fbb34c411fb765153f1877a0348ac51063 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 7 Sep 2024 18:09:27 +0900 Subject: [PATCH 04/13] docs: add note --- admin/RELEASE.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/admin/RELEASE.md b/admin/RELEASE.md index 4f199a821177..6e0b812b25a7 100644 --- a/admin/RELEASE.md +++ b/admin/RELEASE.md @@ -12,6 +12,9 @@ - `4.y`: The next minor version. (e.g., `4.6`) - `4.z`: The next next minor version. (e.g., `4.7`) +> [!NOTE] +> Copy this file, and replace the versions above with the actual versions. + ## Merge `develop` branch into next minor version branch `4.y` Before starting release process, if there are commits in `develop` branch that From 2492078509c7738818a2be05319f181ff58cf30b Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 7 Sep 2024 18:09:59 +0900 Subject: [PATCH 05/13] docs: move item --- admin/RELEASE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/RELEASE.md b/admin/RELEASE.md index 6e0b812b25a7..61667d612178 100644 --- a/admin/RELEASE.md +++ b/admin/RELEASE.md @@ -87,7 +87,6 @@ Work off direct clones of the repos so the release branches persist for a time. cd CodeIgniter4 git diff --name-status origin/master admin/ ``` -* [ ] Merge any Security Advisory PRs in private forks ## Process @@ -95,6 +94,7 @@ Work off direct clones of the repos so the release branches persist for a time. > been included with their PR, so this process assumes you will not be > generating much new content. +* [ ] Merge any Security Advisory PRs in private forks * [ ] Replace **CHANGELOG.md** with the new version generated above * [ ] Update **user_guide_src/source/changelogs/v4.x.x.rst** * Remove the section titles that have no items From cb4ba98ce6c294662e9bcc8d6c27f3ac15288f8b Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 7 Sep 2024 18:10:37 +0900 Subject: [PATCH 06/13] docs: move section --- admin/RELEASE.md | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/admin/RELEASE.md b/admin/RELEASE.md index 61667d612178..30b1f77b7362 100644 --- a/admin/RELEASE.md +++ b/admin/RELEASE.md @@ -38,6 +38,26 @@ If you release a new minor version. "Branch protection rules" to the next minor version. E.g. `4.5` → `4.6` * [ ] Delete the merged `4.y` branch (This closes all PRs to the branch) +## Preparation + +Work off direct clones of the repos so the release branches persist for a time. + +* [ ] Clone both **codeigniter4/CodeIgniter4** and **codeigniter4/userguide** and + resolve any necessary PRs + ```console + rm -rf CodeIgniter4.bk userguide.bk + mv CodeIgniter4 CodeIgniter4.bk + mv userguide userguide.bk + git clone git@github.com:codeigniter4/CodeIgniter4.git + git clone git@github.com:codeigniter4/userguide.git + ``` +* [ ] Vet the **admin/** folders for any removed hidden files (Action deploy scripts + *do not remove these*) + ```console + cd CodeIgniter4 + git diff --name-status origin/master admin/ + ``` + ## Changelog When generating the changelog each Pull Request to be included must have one of @@ -68,26 +88,6 @@ the changelog. Copy the resulting content into **CHANGELOG.md** and adjust the format to match the existing content. -## Preparation - -Work off direct clones of the repos so the release branches persist for a time. - -* [ ] Clone both **codeigniter4/CodeIgniter4** and **codeigniter4/userguide** and - resolve any necessary PRs - ```console - rm -rf CodeIgniter4.bk userguide.bk - mv CodeIgniter4 CodeIgniter4.bk - mv userguide userguide.bk - git clone git@github.com:codeigniter4/CodeIgniter4.git - git clone git@github.com:codeigniter4/userguide.git - ``` -* [ ] Vet the **admin/** folders for any removed hidden files (Action deploy scripts - *do not remove these*) - ```console - cd CodeIgniter4 - git diff --name-status origin/master admin/ - ``` - ## Process > **Note** Most changes that need noting in the User Guide and docs should have From d7bedff4e71c0b4d76888238b13ae369789ecd37 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 7 Sep 2024 18:10:53 +0900 Subject: [PATCH 07/13] docs: use GitHub markdown note format --- admin/RELEASE.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/admin/RELEASE.md b/admin/RELEASE.md index 30b1f77b7362..9ed91e55c183 100644 --- a/admin/RELEASE.md +++ b/admin/RELEASE.md @@ -90,7 +90,8 @@ the existing content. ## Process -> **Note** Most changes that need noting in the User Guide and docs should have +> [!NOTE] +> Most changes that need noting in the User Guide and docs should have > been included with their PR, so this process assumes you will not be > generating much new content. From 22cf15ecf3a306917ef18518aee7f0fc13eddb67 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sun, 8 Sep 2024 11:07:39 +0900 Subject: [PATCH 08/13] docs: improve description for Migration File Names --- user_guide_src/source/dbmgmt/migration.rst | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/user_guide_src/source/dbmgmt/migration.rst b/user_guide_src/source/dbmgmt/migration.rst index dec16c5037ff..c0a565381f5a 100644 --- a/user_guide_src/source/dbmgmt/migration.rst +++ b/user_guide_src/source/dbmgmt/migration.rst @@ -22,19 +22,28 @@ include migrations from all namespaces. Migration File Names ******************** -Each Migration is run in numeric order forward or backwards depending on the -method taken. Each migration is numbered using the timestamp when the migration -was created, in **YYYY-MM-DD-HHIISS** format (e.g., **2012-10-31-100537**). This -helps prevent numbering conflicts when working in a team environment. +A migration file name is made up of a timestamp prefix, an underscore (``_``), +and a descriptive name (classname). + +* 2024-09-08-013653_AddBlogTable.php + +Each migration is numbered using the timestamp (**2024-09-08-013653**) when the +migration was created, in **YYYY-MM-DD-HHIISS** format. -Prefix your migration files with the migration number followed by an underscore -and a descriptive name for the migration. The year, month, and date can be separated -from each other by dashes, underscores, or not at all. For example: +The descriptive name (**AddBlogTable**) for the migration is a classname in PHP. +So you must name a valid classname. + +The year, month, date, and time in a prefix can be separated from each other by +dashes (``-``), underscores (``_``), or not at all. For example: * 2012-10-31-100538_AlterBlogTrackViews.php * 2012_10_31_100539_AlterBlogAddTranslations.php * 20121031100537_AddBlog.php +Each Migration is run in numeric order forward or backwards depending on the +method taken. This helps prevent numbering conflicts when working in a team +environment. + ****************** Create a Migration ****************** From 71137925dced6e3d3da5849d29481e8e762ca358 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sun, 8 Sep 2024 11:07:50 +0900 Subject: [PATCH 09/13] docs: add link to section --- user_guide_src/source/dbmgmt/migration.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/dbmgmt/migration.rst b/user_guide_src/source/dbmgmt/migration.rst index c0a565381f5a..278b6e9ba904 100644 --- a/user_guide_src/source/dbmgmt/migration.rst +++ b/user_guide_src/source/dbmgmt/migration.rst @@ -58,7 +58,7 @@ The database connection and the database Forge class are both available to you t ``$this->db`` and ``$this->forge``, respectively. Alternatively, you can use a command-line call to generate a skeleton migration file. -See **make:migration** in :ref:`command-line-tools` for more details. +See `make:migration`_ in :ref:`command-line-tools` for more details. .. note:: Since the migration class is a PHP class, the classname must be unique in every migration file. From e53c32cd714a70e301d0084d2c5b864cceb0092b Mon Sep 17 00:00:00 2001 From: kenjis Date: Sun, 8 Sep 2024 17:38:09 +0900 Subject: [PATCH 10/13] docs: fix typo --- user_guide_src/source/dbmgmt/migration.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/dbmgmt/migration.rst b/user_guide_src/source/dbmgmt/migration.rst index 278b6e9ba904..5a4bc0852cee 100644 --- a/user_guide_src/source/dbmgmt/migration.rst +++ b/user_guide_src/source/dbmgmt/migration.rst @@ -33,7 +33,7 @@ migration was created, in **YYYY-MM-DD-HHIISS** format. The descriptive name (**AddBlogTable**) for the migration is a classname in PHP. So you must name a valid classname. -The year, month, date, and time in a prefix can be separated from each other by +The year, month, day, and time in a prefix can be separated from each other by dashes (``-``), underscores (``_``), or not at all. For example: * 2012-10-31-100538_AlterBlogTrackViews.php From 377679065f44427cfffb6ed92165a8bf4133f501 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2024 15:43:31 +0000 Subject: [PATCH 11/13] chore(deps-dev): update rector/rector requirement from 1.2.4 to 1.2.5 Updates the requirements on [rector/rector](https://github.com/rectorphp/rector) to permit the latest version. - [Release notes](https://github.com/rectorphp/rector/releases) - [Commits](https://github.com/rectorphp/rector/compare/1.2.4...1.2.5) --- updated-dependencies: - dependency-name: rector/rector dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c2ed6374b550..5f85a575b3b8 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "phpunit/phpcov": "^9.0.2 || ^10.0", "phpunit/phpunit": "^10.5.16 || ^11.2", "predis/predis": "^1.1 || ^2.0", - "rector/rector": "1.2.4" + "rector/rector": "1.2.5" }, "replace": { "codeigniter4/framework": "self.version" From 0a9835b40d230215c480ccda771de2de9a1bdbfa Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Tue, 10 Sep 2024 03:58:56 +0700 Subject: [PATCH 12/13] Fix phpstan --- system/Cache/Handlers/RedisHandler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/Cache/Handlers/RedisHandler.php b/system/Cache/Handlers/RedisHandler.php index 22f4e43540dd..6cd43506bdb5 100644 --- a/system/Cache/Handlers/RedisHandler.php +++ b/system/Cache/Handlers/RedisHandler.php @@ -108,7 +108,7 @@ public function initialize() public function get(string $key) { $key = static::validateKey($key, $this->prefix); - $data = $this->redis->hMGet($key, ['__ci_type', '__ci_value']); + $data = $this->redis->hMget($key, ['__ci_type', '__ci_value']); if (! isset($data['__ci_type'], $data['__ci_value']) || $data['__ci_value'] === false) { return null; @@ -147,7 +147,7 @@ public function save(string $key, $value, int $ttl = 60) return false; } - if (! $this->redis->hMSet($key, ['__ci_type' => $dataType, '__ci_value' => $value])) { + if (! $this->redis->hMset($key, ['__ci_type' => $dataType, '__ci_value' => $value])) { return false; } From 45a002fbc1f3d750f7f81f5fb04af31baee1a777 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Tue, 10 Sep 2024 05:56:06 +0700 Subject: [PATCH 13/13] refactor: enable TypedPropertyFromAssignsRector --- rector.php | 2 ++ system/Config/Factories.php | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/rector.php b/rector.php index e16de7bae441..14a079e0ab04 100644 --- a/rector.php +++ b/rector.php @@ -55,6 +55,7 @@ use Rector\TypeDeclaration\Rector\Closure\AddClosureVoidReturnTypeWhereNoReturnRector; use Rector\TypeDeclaration\Rector\Empty_\EmptyOnNullableObjectToInstanceOfRector; use Rector\TypeDeclaration\Rector\Function_\AddFunctionVoidReturnTypeWhereNoReturnRector; +use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector; use Rector\TypeDeclaration\Rector\StmtsAwareInterface\DeclareStrictTypesRector; use Utils\Rector\PassStrictParameterToFunctionParameterRector; use Utils\Rector\RemoveErrorSuppressInTryCatchStmtsRector; @@ -215,6 +216,7 @@ AddClosureVoidReturnTypeWhereNoReturnRector::class, AddFunctionVoidReturnTypeWhereNoReturnRector::class, AddMethodCallBasedStrictParamTypeRector::class, + TypedPropertyFromAssignsRector::class, ]) ->withConfiguredRule(StringClassNameToClassConstantRector::class, [ // keep '\\' prefix string on string '\Foo\Bar' diff --git a/system/Config/Factories.php b/system/Config/Factories.php index d98664a24a7b..be66005a8adf 100644 --- a/system/Config/Factories.php +++ b/system/Config/Factories.php @@ -37,7 +37,7 @@ final class Factories * * @var array> */ - private static $options = []; + private static array $options = []; /** * Explicit options for the Config @@ -65,7 +65,7 @@ final class Factories * * @var array> */ - private static $aliases = []; + private static array $aliases = []; /** * Store for instances of any component that @@ -78,7 +78,7 @@ final class Factories * * @var array> */ - private static $instances = []; + private static array $instances = []; /** * Whether the component instances are updated? @@ -87,7 +87,7 @@ final class Factories * * @internal For caching only */ - private static $updated = []; + private static array $updated = []; /** * Define the class to load. You can *override* the concrete class.