Skip to content

Commit 7a34315

Browse files
authored
Merge pull request #6771 from kenjis/fix-time-mutable
fix: make Time immutable
2 parents ecc77fc + 0eca247 commit 7a34315

File tree

9 files changed

+2475
-1169
lines changed

9 files changed

+2475
-1169
lines changed

system/I18n/Time.php

Lines changed: 2 additions & 1157 deletions
Large diffs are not rendered by default.

system/I18n/TimeLegacy.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
/**
4+
* This file is part of CodeIgniter 4 framework.
5+
*
6+
* (c) CodeIgniter Foundation <[email protected]>
7+
*
8+
* For the full copyright and license information, please view
9+
* the LICENSE file that was distributed with this source code.
10+
*/
11+
12+
namespace CodeIgniter\I18n;
13+
14+
use DateTime;
15+
16+
/**
17+
* Legacy Time class.
18+
*
19+
* This class is only for backward compatibility. Do not use.
20+
* This is not immutable! Some methods are immutable,
21+
* but some methods can alter the state.
22+
*
23+
* @property string $date
24+
*
25+
* @deprecated Use Time instead.
26+
*/
27+
class TimeLegacy extends DateTime
28+
{
29+
use TimeTrait;
30+
}

0 commit comments

Comments
 (0)