UuidDecorator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
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;
4
5
use Percy\Entity\EntityInterface;
6
use Ramsey\Uuid\Uuid;
7
8
class UuidDecorator implements DecoratorInterface
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13 1
    public function __invoke(EntityInterface $entity, array $properties = [])
14
    {
15 1
        foreach ($properties as $property) {
16 1
            $entity[$property] = Uuid::uuid4()->toString();
17 1
        }
18 1
    }
19
}
20