Boundaries.php
4 years ago
Cast.php
4 years ago
Comparison.php
2 years ago
Converter.php
2 years ago
Creator.php
2 years ago
Date.php
8 months ago
DeprecatedProperties.php
4 years ago
Difference.php
2 years ago
IntervalRounding.php
2 years ago
IntervalStep.php
4 years ago
Localization.php
8 months ago
Macro.php
4 years ago
MagicParameter.php
2 years ago
Mixin.php
2 years ago
Modifiers.php
4 years ago
Mutability.php
4 years ago
ObjectInitialisation.php
4 years ago
Options.php
2 years ago
Rounding.php
2 years ago
Serialization.php
2 years ago
Test.php
8 months ago
Timestamp.php
1 year ago
ToStringFormat.php
3 years ago
Units.php
2 years ago
Week.php
4 years ago
index.php
3 years ago
Mutability.php
28 lines
| 1 | <?php |
| 2 | namespace MailPoetVendor\Carbon\Traits; |
| 3 | if (!defined('ABSPATH')) exit; |
| 4 | use MailPoetVendor\Carbon\Carbon; |
| 5 | use MailPoetVendor\Carbon\CarbonImmutable; |
| 6 | trait Mutability |
| 7 | { |
| 8 | use Cast; |
| 9 | public static function isMutable() |
| 10 | { |
| 11 | return \false; |
| 12 | } |
| 13 | public static function isImmutable() |
| 14 | { |
| 15 | return !static::isMutable(); |
| 16 | } |
| 17 | public function toMutable() |
| 18 | { |
| 19 | $date = $this->cast(Carbon::class); |
| 20 | return $date; |
| 21 | } |
| 22 | public function toImmutable() |
| 23 | { |
| 24 | $date = $this->cast(CarbonImmutable::class); |
| 25 | return $date; |
| 26 | } |
| 27 | } |
| 28 |