Event::getDomainEvent()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 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
}