Skip to content

Commit 1fe0fa4

Browse files
committed
doc: add more details to upgrade notes for 4.7 release
1 parent cce6f01 commit 1fe0fa4

File tree

2 files changed

+100
-0
lines changed

2 files changed

+100
-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: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,98 @@ 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+
Primary key values are now validated before database queries in
43+
``insert()``/``insertBatch()`` (without auto-increment), ``update()``, and
44+
``delete()``.
45+
46+
Invalid primary key values now throw ``InvalidArgumentException`` instead of
47+
database-layer ``DatabaseException``.
48+
49+
If your code catches ``DatabaseException`` for invalid primary keys, update it
50+
to handle ``InvalidArgumentException`` as well.
51+
52+
Entity Change Detection Is Now Deep
53+
===================================
54+
55+
``Entity::hasChanged()`` and ``Entity::syncOriginal()`` now perform deep
56+
comparison for arrays and objects.
57+
58+
If you relied on the previous shallow (reference-based) behavior, review your
59+
entity update flows and tests because nested changes are now detected.
60+
61+
Also, ``Entity::toRawArray()`` now recursively converts arrays of entities when
62+
``$recursive`` is ``true``.
63+
64+
Encryption Handler Key State
65+
============================
66+
67+
``OpenSSLHandler`` and ``SodiumHandler`` no longer mutate the handler's internal
68+
key when a key is passed via ``$params`` to ``encrypt()``/``decrypt()``.
69+
70+
If your code depended on passing a key once and reusing it implicitly later,
71+
move to explicit key configuration in ``Config\\Encryption`` (or pass a custom
72+
config when creating the encrypter service).
73+
74+
Interface Changes
75+
=================
76+
77+
Some interface changes have been made. Classes that implement framework
78+
interfaces should update their APIs to reflect these changes.
79+
80+
See :ref:`ChangeLog <v470-interface-changes>` for details.
81+
82+
Method Signature Changes
83+
========================
84+
85+
Some method signature changes have been made. Classes that extend framework
86+
classes should update their method signatures to keep LSP compatibility.
87+
88+
See :ref:`ChangeLog <v470-method-signature-changes>` for details.
89+
90+
Property Signature Changes
91+
==========================
92+
93+
Some property type signatures have changed (for example nullable
94+
``Entity::$dataCaster``). If you extend these classes, update your code
95+
accordingly.
96+
97+
See :ref:`ChangeLog <v470-property-signature-changes>` for details.
98+
99+
Removed Deprecated Items
100+
========================
101+
102+
Some deprecated items have been removed. If your app still uses or extends
103+
these APIs, update your code before upgrading.
104+
105+
See :ref:`ChangeLog <v470-removed-deprecated-items>` for details.
106+
15107
*************
16108
Project Files
17109
*************

0 commit comments

Comments
 (0)