Completed
Push — master ( ba32a2...f7ebe3 )
by Song
03:06
created

DefaultDatetimeFormat   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A serializeDate() 0 8 2
1
<?php
2
3
namespace Encore\Admin\Traits;
4
5
use Carbon\Carbon;
6
7
trait DefaultDatetimeFormat
8
{
9
    protected function serializeDate(\DateTimeInterface $date)
10
    {
11
        if (version_compare(app()->version(), '7.0.0') < 0) {
12
            return parent::serializeDate($date);
13
        }
14
15
        return $date->format(Carbon::DEFAULT_TO_STRING_FORMAT);
16
    }
17
}