NowTimestampDecorator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 12
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 6 2
1
<?php
2
3
namespace Percy\Decorator\Date;
4
5
use DateTime;
6
use Percy\Decorator\DecoratorInterface;
7
use Percy\Entity\EntityInterface;
8
9
class NowTimestampDecorator implements DecoratorInterface
10
{
11
    /**
12
     * {@inheritdoc}
13
     */
14 1
    public function __invoke(EntityInterface $entity, array $properties = [])
15
    {
16 1
        foreach ($properties as $property) {
17 1
            $entity[$property] = (new DateTime)->format('U');
18 1
        }
19 1
    }
20
}
21