X7ROOT File Manager
Current Path:
/home/gfecatvj/sites/vendor/nesbot/carbon/src/Carbon/Traits
home
/
gfecatvj
/
sites
/
vendor
/
nesbot
/
carbon
/
src
/
Carbon
/
Traits
/
📁
..
📄
Boundaries.php
(11.04 KB)
📄
Cast.php
(864 B)
📄
Comparison.php
(30.28 KB)
📄
Converter.php
(15.06 KB)
📄
Creator.php
(28.19 KB)
📄
Date.php
(156.41 KB)
📄
Difference.php
(48.99 KB)
📄
IntervalRounding.php
(1.54 KB)
📄
IntervalStep.php
(2.28 KB)
📄
Localization.php
(27.21 KB)
📄
Macro.php
(3.02 KB)
📄
Mixin.php
(3.93 KB)
📄
Modifiers.php
(13.27 KB)
📄
Mutability.php
(1.3 KB)
📄
ObjectInitialisation.php
(428 B)
📄
Options.php
(12.17 KB)
📄
Rounding.php
(6.35 KB)
📄
Serialization.php
(4.44 KB)
📄
Test.php
(4.27 KB)
📄
Timestamp.php
(3.18 KB)
📄
Units.php
(11.59 KB)
📄
Week.php
(7.15 KB)
Editing: Cast.php
<?php namespace Carbon\Traits; use Carbon\Exceptions\InvalidCastException; use DateTimeInterface; /** * Trait Cast. * * Utils to cast into an other class. */ trait Cast { /** * Cast the current instance into the given class. * * @param string $className The $className::instance() method will be called to cast the current object. * * @return DateTimeInterface */ public function cast(string $className) { if (!method_exists($className, 'instance')) { if (is_a($className, DateTimeInterface::class, true)) { return new $className($this->rawFormat('Y-m-d H:i:s.u'), $this->getTimezone()); } throw new InvalidCastException("$className has not the instance() method needed to cast the date."); } return $className::instance($this); } }
Upload File
Create Folder