Base::format()   A
last analyzed

Complexity

Conditions 2
Paths 3

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 5
nc 3
nop 2
dl 0
loc 7
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace HexMakina\Tempus;
4
5
abstract class Base
6
{
7
    public static function format($parm = 'now', $format)
8
    {
9
        try {
10
            $date = new \DateTimeImmutable("$parm");
11
            return $date->format($format);
12
        } catch (\Exception $e) {
13
            return null;
14
        }
15
    }
16
}
17