Log   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 70
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A getLevel() 0 4 1
A getMessage() 0 4 1
A getContext() 0 4 1
A getStack() 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;
10
11
use Symfony\Component\EventDispatcher\Event;
12
13
class Log extends Event
14
{
15
    const EVENT_NAME = 'profiler.log';
16
17
    protected $level;
18
19
    protected $message;
20
21
    protected $context;
22
23
    protected $stack;
24
25
    protected $timestamp;
26
27
    /**
28
     * Log constructor.
29
     * @param $level
30
     * @param $message
31
     * @param $context
32
     * @param $stack
33
     */
34 6
    public function __construct($level, $message, $context, $stack = [])
35
    {
36 6
        $this->level = $level;
37 6
        $this->message = $message;
38 6
        $this->context = $context;
39 6
        $this->stack = $stack;
40 6
        $this->timestamp = time();
41 6
    }
42
43
    /**
44
     * @return mixed
45
     */
46 2
    public function getLevel()
47
    {
48 2
        return $this->level;
49
    }
50
51
    /**
52
     * @return mixed
53
     */
54 2
    public function getMessage()
55
    {
56 2
        return $this->message;
57
    }
58
59
    /**
60
     * @return mixed
61
     */
62 2
    public function getContext()
63
    {
64 2
        return $this->context;
65
    }
66
67
    /**
68
     * @return mixed
69
     */
70 2
    public function getStack()
71
    {
72 2
        return $this->stack;
73
    }
74
75
    /**
76
     * @return array
77
     */
78 6
    public function toArray()
79
    {
80 6
        return get_object_vars($this);
81
    }
82
}
83