diff --git a/admin/RELEASE.md b/admin/RELEASE.md index 4f199a821177..9ed91e55c183 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 @@ -35,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 @@ -65,33 +88,14 @@ 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/ - ``` -* [ ] Merge any Security Advisory PRs in private forks - ## 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. +* [ ] 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 diff --git a/composer.json b/composer.json index 5ec5db01ce5b..984ab2b61b54 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" 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/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; } diff --git a/system/Config/Factories.php b/system/Config/Factories.php index dfd1c38b4f9a..2d93011a7455 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. diff --git a/user_guide_src/source/changelogs/index.rst b/user_guide_src/source/changelogs/index.rst index d8e024cf3f65..8602df634298 100644 --- a/user_guide_src/source/changelogs/index.rst +++ b/user_guide_src/source/changelogs/index.rst @@ -13,6 +13,7 @@ See all the changes. :titlesonly: v4.6.0 + 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/dbmgmt/migration.rst b/user_guide_src/source/dbmgmt/migration.rst index dec16c5037ff..5a4bc0852cee 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, 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 * 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 ****************** @@ -49,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. diff --git a/user_guide_src/source/helpers/url_helper.rst b/user_guide_src/source/helpers/url_helper.rst index 9278539b3aea..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 @@ -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 @@ -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 @@ -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 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 c56cd0994917..2b9b5bffc486 100644 --- a/user_guide_src/source/installation/upgrading.rst +++ b/user_guide_src/source/installation/upgrading.rst @@ -17,6 +17,7 @@ See also :doc:`./backward_compatibility_notes`. backward_compatibility_notes upgrade_460 + upgrade_456 upgrade_455 upgrade_454 upgrade_453