Datetime   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 2
dl 0
loc 12
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A datetime() 0 3 2
1
<?php
2
3
namespace Sfneal\Models\Traits;
4
5
trait Datetime
6
{
7
    /**
8
     * Format a datetime string.
9
     *
10
     * @param  string  $format
11
     * @param  string|null  $datetime
12
     * @return string
13
     */
14
    private static function datetime(string $format, string $datetime = null): string
15
    {
16
        return (isset($datetime)) ? date($format, strtotime($datetime)) : '';
17
    }
18
}
19