DateArrayFormatter   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 28.57%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 18
ccs 2
cts 7
cp 0.2857
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 10 2
A get() 0 4 1
1
<?php
2
3
namespace BZIon\Twig;
4
5
class DateArrayFormatter
6
{
7
    public function __invoke(array $dates, $format)
8
    {
9
        foreach ($dates as &$date)
10
        {
11
            $dt = new \DateTime($date);
12
            $date = $dt->format($format);
13
        }
14
15
        return $dates;
16
    }
17
18 1
    public static function get()
19
    {
20 1
        return (new \Twig_SimpleFilter('date_array_formatter', new self()));
21
    }
22
}
23