Test Failed
Push — develop ( d3d02f...9481b3 )
by Brent
04:21
created

Event   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 48
rs 10
c 1
b 0
f 0
wmc 4
lcom 0
cbo 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A create() 0 3 1
A getData() 0 3 1
A getEventHook() 0 3 1
1
<?php
2
3
namespace Brendt\Stitcher\Event;
4
5
use \Symfony\Component\EventDispatcher\Event as SymfonyEvent;
6
7
class Event extends SymfonyEvent
8
{
9
    /**
10
     * @var array
11
     */
12
    private $data;
13
14
    /**
15
     * @var string
16
     */
17
    private $eventHook;
18
19
    /**
20
     * Event constructor.
21
     *
22
     * @param array       $data
23
     * @param string|null $eventHook
24
     */
25
    public function __construct($data = [], string $eventHook = null) {
26
        $this->data = $data;
27
        $this->eventHook = $eventHook;
28
    }
29
30
    /**
31
     * @param array       $data
32
     * @param string|null $eventHook
33
     *
34
     * @return Event
35
     */
36
    public static function create($data = [], string $eventHook = null) : Event {
37
        return new self($data, $eventHook);
38
    }
39
40
    /**
41
     * @return mixed
42
     */
43
    public function getData() {
44
        return $this->data;
45
    }
46
47
    /**
48
     * @return string
49
     */
50
    public function getEventHook() : string {
51
        return $this->eventHook;
52
    }
53
54
}
55