Conditions | 7 |
Paths | 7 |
Total Lines | 28 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 56 |
Changes | 0 |
1 | <?php |
||
69 | public function fromEnumeration(string $value): string |
||
70 | { |
||
71 | switch ($value) { |
||
72 | /** |
||
73 | * Compatibility bugfix. |
||
74 | * @see http://php.net/manual/en/class.datetime.php |
||
75 | */ |
||
76 | case static::ISO8601: |
||
77 | return Carbon::RFC3339; |
||
78 | |||
79 | case static::RFC7231: |
||
80 | return Carbon::RFC7231_FORMAT; |
||
81 | |||
82 | case static::DATE_TIME: |
||
83 | return 'Y-m-d H:i:s'; |
||
84 | |||
85 | case static::DATE: |
||
86 | return 'Y-m-d'; |
||
87 | |||
88 | case static::TIME: |
||
89 | return 'H:i:s'; |
||
90 | |||
91 | case static::HUMAN_READABLE: |
||
92 | return static::HUMAN_READABLE; |
||
93 | } |
||
94 | |||
95 | return \constant(Carbon::class . '::' . $value); |
||
96 | } |
||
97 | } |
||
98 |