Passed
Push — master ( e140d0...d9458c )
by Gabriel
12:38
created

Event   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 3
eloc 8
c 1
b 1
f 0
dl 0
loc 28
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A addData() 0 3 1
A getData() 0 3 1
1
<?php
2
3
namespace ByTIC\EventDispatcher\Tests\Fixtures\Events;
4
5
use ByTIC\EventDispatcher\Events\Dispatchable;
6
use ByTIC\EventDispatcher\Events\EventInterface;
7
use ByTIC\EventDispatcher\Events\EventTrait;
8
use Psr\EventDispatcher\StoppableEventInterface;
9
10
/**
11
 * Class Event
12
 * @package ByTIC\EventDispatcher\Tests\Fixtures\Events
13
 */
14
class Event implements EventInterface, StoppableEventInterface
15
{
16
    use EventTrait;
17
    use Dispatchable;
18
19
    public $arguments = [];
20
21
    public function __construct()
22
    {
23
        $this->arguments = func_get_args();
24
    }
25
26
    protected $data = '';
27
28
    /**
29
     * @param $data
30
     */
31
    public function addData($data)
32
    {
33
        $this->data .= $data;
34
    }
35
36
    /**
37
     * @return string
38
     */
39
    public function getData(): string
40
    {
41
        return $this->data;
42
    }
43
}
44