End   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 1 Features 1
Metric Value
wmc 5
c 4
b 1
f 1
lcom 0
cbo 1
dl 0
loc 49
ccs 10
cts 10
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 2
A getKey() 0 4 1
A getTimestamp() 0 4 1
A toArray() 0 4 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: arnaud
5
 * Date: 01/11/15
6
 * Time: 23:26
7
 */
8
9
namespace Ndrx\Profiler\Events\Timeline;
10
11
use Symfony\Component\EventDispatcher\Event;
12
13
class End extends Event
14
{
15
    const EVENT_NAME = 'profiler.timeline_end';
16
17
    /**
18
     * @var string
19
     */
20
    protected $key;
21
22
    /**
23
     * @var float
24
     */
25
    protected $timestamp;
26
27
    /**
28
     * End constructor.
29
     * @param string $key
30
     * @param float $timestamp
31
     */
32 4
    public function __construct($key, $timestamp = null)
33
    {
34 4
        $this->key = $key;
35 4
        $this->timestamp = $timestamp === null ? microtime(true) : $timestamp;
36 4
    }
37
38
    /**
39
     * @return string
40
     */
41 4
    public function getKey()
42
    {
43 4
        return $this->key;
44
    }
45
46
    /**
47
     * @return float
48
     */
49 4
    public function getTimestamp()
50
    {
51 4
        return $this->timestamp;
52
    }
53
54
    /**
55
     * @return array
56
     */
57 2
    public function toArray()
58
    {
59 2
        return get_object_vars($this);
60
    }
61
}
62