Completed
Push — master ( 6e0bb5...dae7dc )
by GBProd
04:09
created

Event   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getDomainEvent() 0 4 1
1
<?php
2
3
namespace GBProd\DomainEventBundle\Event;
4
5
use GBProd\DomainEvent\DomainEvent;
6
use Symfony\Component\EventDispatcher\Event as BaseEvent;
7
8
/**
9
 * Symfony event wrapping domain event
10
 * 
11
 * @author gbprod <[email protected]>
12
 */
13
class Event extends BaseEvent
14
{
15
    /**
16
     * @param DomainEvent $domainEvent
17
     */
18 2
    public function __construct(DomainEvent $domainEvent)
19
    {
20 2
        $this->domainEvent = $domainEvent;
0 ignored issues
show
Bug introduced by
The property domainEvent does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
21 2
    }
22
    
23
    /**
24
     * Return wrapped domain event
25
     * 
26
     * @return DomainEvent
27
     */
28 1
    public function getDomainEvent()
29
    {
30 1
        return $this->domainEvent; 
31
    }
32
}