AsUpdatedAtUsec   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A onPreSave() 0 4 1
1
<?php
2
/**
3
 * File was created 05.10.2015 17:01
4
 */
5
6
namespace PeekAndPoke\Component\Slumber\Annotation\Slumber\Store;
7
8
use Doctrine\Common\Annotations\Annotation;
9
use PeekAndPoke\Component\Slumber\Annotation\PropertyPreSaveVisitorMarker;
10
use PeekAndPoke\Component\Slumber\Annotation\SlumberAnnotation;
11
use Psr\Container\ContainerInterface;
12
13
/**
14
 * @Annotation
15
 * @Annotation\Target("PROPERTY")
16
 *
17
 * @author Karsten J. Gerber <[email protected]>
18
 */
19
class AsUpdatedAtUsec extends SlumberAnnotation implements PropertyPreSaveVisitorMarker
20
{
21
    /**
22
     * @param ContainerInterface  $provider
23
     * @param mixed               $subject
24
     * @param \ReflectionProperty $property
25
     */
26 27
    public function onPreSave(ContainerInterface $provider, $subject, \ReflectionProperty $property)
27
    {
28 27
        $property->setValue($subject, microtime(true));
29 27
    }
30
}
31