Completed
Push — master ( f25faa...8ce9e6 )
by Younes
01:47
created

helpers.php ➔ date_transformer()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 5
nc 2
nop 1
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
if (! function_exists('date_transformer')) {
4
    function date_transformer($value)
5
    {
6
        $transformers = collect(config('rateable.date-transformers'));
7
8
        if ($transformers->isEmpty() || ! $transformers->has((string) $value)) {
9
            return $value;
10
        }
11
12
        return $transformers->get($value);
13
    }
14
}
15