Skip to content

Commit 787375f

Browse files
authored
docs: add more details to upgrade notes for 4.7 release (#9942)
* doc: add more details to upgrade notes for 4.7 release * add info about insertBatch/updateBatch changes
1 parent e704318 commit 787375f

File tree

2 files changed

+104
-0
lines changed

2 files changed

+104
-0
lines changed

user_guide_src/source/changelogs/v4.7.0.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ To use a different encryption key permanently, pass a custom config when creatin
173173
// Get a new handler instance with the custom config (not shared)
174174
$handler = service('encrypter', $config, false);
175175
176+
.. _v470-interface-changes:
177+
176178
Interface Changes
177179
=================
178180

@@ -183,6 +185,8 @@ Interface Changes
183185
- **Database:** The ``QueryInterface`` now includes the ``getOriginalQuery()`` method.
184186
- **Images:** The ``ImageHandlerInterface`` now includes a new method: ``clearMetadata()``.
185187

188+
.. _v470-method-signature-changes:
189+
186190
Method Signature Changes
187191
========================
188192

@@ -235,11 +239,15 @@ Method Signature Changes
235239
- ``CodeIgniter\Session\Handlers\RedisHandler::read($id): false|string``
236240
- ``CodeIgniter\Session\Handlers\RedisHandler::gc($max_lifetime): int``
237241

242+
.. _v470-property-signature-changes:
243+
238244
Property Signature Changes
239245
==========================
240246

241247
- **Entity:** The protected property ``CodeIgniter\Entity\Entity::$dataCaster`` type has been changed from ``DataCaster`` to ``?DataCaster`` (nullable).
242248

249+
.. _v470-removed-deprecated-items:
250+
243251
Removed Deprecated Items
244252
========================
245253

user_guide_src/source/installation/upgrade_470.rst

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,102 @@ Please refer to the upgrade instructions corresponding to your installation meth
1212
:local:
1313
:depth: 2
1414

15+
****************
16+
Breaking Changes
17+
****************
18+
19+
PHP 8.2 Required
20+
================
21+
22+
The minimum PHP requirement has been updated to **PHP 8.2**.
23+
24+
If your current runtime is older than PHP 8.2, upgrade PHP first before
25+
upgrading CodeIgniter.
26+
27+
Validation ``regex_match`` Placeholders
28+
=======================================
29+
30+
Placeholders in the ``regex_match`` validation rule must now use double curly
31+
braces.
32+
33+
If you previously used single braces like
34+
``regex_match[/^{placeholder}$/]``, update it to:
35+
``regex_match[/^{{placeholder}}$/]``.
36+
37+
This avoids ambiguity with regex quantifiers such as ``{1,3}``.
38+
39+
Model Primary Key Validation Timing and Exceptions
40+
==================================================
41+
42+
The ``insertBatch()`` and ``updateBatch()`` methods now honor model settings
43+
like ``updateOnlyChanged`` and ``allowEmptyInserts``. This change ensures
44+
consistent handling across all insert/update operations.
45+
46+
Primary key values are now validated before database queries in
47+
``insert()``/``insertBatch()`` (without auto-increment), ``update()``, and
48+
``delete()``.
49+
50+
Invalid primary key values now throw ``InvalidArgumentException`` instead of
51+
database-layer ``DatabaseException``.
52+
53+
If your code catches ``DatabaseException`` for invalid primary keys, update it
54+
to handle ``InvalidArgumentException`` as well.
55+
56+
Entity Change Detection Is Now Deep
57+
===================================
58+
59+
``Entity::hasChanged()`` and ``Entity::syncOriginal()`` now perform deep
60+
comparison for arrays and objects.
61+
62+
If you relied on the previous shallow (reference-based) behavior, review your
63+
entity update flows and tests because nested changes are now detected.
64+
65+
Also, ``Entity::toRawArray()`` now recursively converts arrays of entities when
66+
``$recursive`` is ``true``.
67+
68+
Encryption Handler Key State
69+
============================
70+
71+
``OpenSSLHandler`` and ``SodiumHandler`` no longer mutate the handler's internal
72+
key when a key is passed via ``$params`` to ``encrypt()``/``decrypt()``.
73+
74+
If your code depended on passing a key once and reusing it implicitly later,
75+
move to explicit key configuration in ``Config\\Encryption`` (or pass a custom
76+
config when creating the encrypter service).
77+
78+
Interface Changes
79+
=================
80+
81+
Some interface changes have been made. Classes that implement framework
82+
interfaces should update their APIs to reflect these changes.
83+
84+
See :ref:`ChangeLog <v470-interface-changes>` for details.
85+
86+
Method Signature Changes
87+
========================
88+
89+
Some method signature changes have been made. Classes that extend framework
90+
classes should update their method signatures to keep LSP compatibility.
91+
92+
See :ref:`ChangeLog <v470-method-signature-changes>` for details.
93+
94+
Property Signature Changes
95+
==========================
96+
97+
Some property type signatures have changed (for example nullable
98+
``Entity::$dataCaster``). If you extend these classes, update your code
99+
accordingly.
100+
101+
See :ref:`ChangeLog <v470-property-signature-changes>` for details.
102+
103+
Removed Deprecated Items
104+
========================
105+
106+
Some deprecated items have been removed. If your app still uses or extends
107+
these APIs, update your code before upgrading.
108+
109+
See :ref:`ChangeLog <v470-removed-deprecated-items>` for details.
110+
15111
*************
16112
Project Files
17113
*************

0 commit comments

Comments
 (0)