Skip to content

Commit 12f3a1e

Browse files
committed
docs: add changelog and upgrade guide
1 parent c1c1dbd commit 12f3a1e

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

user_guide_src/source/changelogs/v4.3.0.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,22 @@ For example, the Exit code has been changed like the following:
4242
- If an uncaught ``CastException`` occurs, the Exit code is ``EXIT_CONFIG`` (= ``3``) instead of ``9``.
4343
- If an uncaught ``DatabaseException`` occurs, the Exit code is ``EXIT_DATABASE`` (= ``8``) instead of ``17``.
4444

45+
.. _v430-time-fix:
46+
47+
Time
48+
----
49+
50+
The following methods of the :doc:`Time <../libraries/time>` class had bugs that changed the state of the current object. To fix these bugs, the Time class has been fixed:
51+
- ``add()``
52+
- ``modify()``
53+
- ``setDate()``
54+
- ``setISODate()``
55+
- ``setTime()``
56+
- ``sub()``
57+
58+
- Now the ``Time`` class extends ``DateTimeImmutable`` and is completely immutable.
59+
- ``TimeLegacy`` class has been added for backward compatibility, which behaves the same as the unmodified ``Time`` class.
60+
4561
Others
4662
------
4763

user_guide_src/source/installation/upgrade_430.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,15 @@ Validation Changes
8080
- ``ValidationInterface`` has been changed. Implemented classes should likewise add the methods and the parameters so as not to break LSP. See :ref:`v430-validation-changes` for details.
8181
- The return value of ``Validation::loadRuleGroup()`` has been changed ``null`` to ``[]`` when the ``$group`` is empty. Update the code if you depend on the behavior.
8282

83+
Time Fixes
84+
==========
85+
86+
Due to bug fixes, some methods in :doc:`Time <../libraries/time>` has been changed the behavior from mutable to immutable. See :ref:`ChangeLog <v430-time-fix>` for details.
87+
88+
If you need the behavior of ``Time`` before the modification, a compatible ``TimeLegacy`` class has been added. Please replace all ``Time`` with ``TimeLegacy`` in your application code.
89+
90+
But ``TimeLegacy`` is deprecated. So we recommend you update your code.
91+
8392
.. _upgrade-430-stream-filter:
8493

8594
Capturing STDERR and STDOUT streams in tests

user_guide_src/source/libraries/time.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ CodeIgniter provides a fully-localized, immutable, date/time class that is built
66
extension's features to convert times across timezones and display the output correctly for different locales. This class
77
is the ``Time`` class and lives in the ``CodeIgniter\I18n`` namespace.
88

9-
.. note:: Since the Time class extends DateTimeImmutable, if there are features that you need that this class doesn't provide,
10-
you can likely find them within the `DateTime <https://www.php.net/manual/en/class.datetimeimmutable.php>`_ class itself.
9+
.. note:: Since the Time class extends ``DateTimeImmutable``, if there are features that you need that this class doesn't provide,
10+
you can likely find them within the `DateTimeImmutable <https://www.php.net/manual/en/class.datetimeimmutable.php>`_ class itself.
11+
12+
.. note:: Prior to v4.3.0, the Time class extended ``DateTime`` and some inherited methods changed
13+
the current object state. The bug was fixed in v4.3.0. If you need the old Time class for backward
14+
compatibility, you can use deprecated ``TimeLegay`` class for the time being.
1115

1216
.. contents::
1317
:local:

0 commit comments

Comments
 (0)