Completed
Push — master ( ef5030...d21931 )
by Phil
02:47
created

UuidDecorator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

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

1 Method

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