File Manager Lite
Dir:
/home/codewavebd/public_html/vendor/nesbot/carbon/src/Carbon/Traits
Upload
[..]
Boundaries.php (12.15 KB)
Edit
Rename
Del
Cast.php (1.16 KB)
Edit
Rename
Del
Comparison.php (46.09 KB)
Edit
Rename
Del
Converter.php (14.12 KB)
Edit
Rename
Del
Creator.php (31.13 KB)
Edit
Rename
Del
Date.php (350.15 KB)
Edit
Rename
Del
DeprecatedPeriodProperties.php (1.89 KB)
Edit
Rename
Del
Difference.php (42.63 KB)
Edit
Rename
Del
IntervalRounding.php (1.65 KB)
Edit
Rename
Del
IntervalStep.php (2.86 KB)
Edit
Rename
Del
LocalFactory.php (1.59 KB)
Edit
Rename
Del
Macro.php (2.71 KB)
Edit
Rename
Del
MagicParameter.php (747 B)
Edit
Rename
Del
Mixin.php (7.28 KB)
Edit
Rename
Del
Mutability.php (1.27 KB)
Edit
Rename
Del
ObjectInitialisation.php (448 B)
Edit
Rename
Del
Options.php (5.92 KB)
Edit
Rename
Del
Rounding.php (6.93 KB)
Edit
Rename
Del
StaticOptions.php (5.28 KB)
Edit
Rename
Del
Test.php (6.28 KB)
Edit
Rename
Del
Timestamp.php (6.45 KB)
Edit
Rename
Del
Units.php (19.07 KB)
Edit
Rename
Del
Week.php (7.54 KB)
Edit
Rename
Del
Edit: Mutability.php
<?php declare(strict_types=1); /** * This file is part of the Carbon package. * * (c) Brian Nesbitt <brian@nesbot.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; use Carbon\Carbon; use Carbon\CarbonImmutable; /** * Trait Mutability. * * Utils to know if the current object is mutable or immutable and convert it. */ trait Mutability { use Cast; /** * Returns true if the current class/instance is mutable. */ public static function isMutable(): bool { return false; } /** * Returns true if the current class/instance is immutable. */ public static function isImmutable(): bool { return !static::isMutable(); } /** * Return a mutable copy of the instance. */ public function toMutable(): Carbon { return $this->cast(Carbon::class); } /** * Return an immutable copy of the instance. */ public function toImmutable(): CarbonImmutable { // Immutable objects are fine as is (uncloned) if ($this::class === CarbonImmutable::class) { return $this; } return $this->cast(CarbonImmutable::class); } }
Simpan