Completed
Pull Request — master (#46)
by Ekin
06:38
created

src/Event/BaseEvent.php (1 issue)

Labels
Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php declare(strict_types=1);
2
3
namespace ekinhbayar\GitAmp\Event;
4
5
use ekinhbayar\GitAmp\Presentation\Information;
6
use ekinhbayar\GitAmp\Presentation\Type;
7
use ekinhbayar\GitAmp\Presentation\Ring;
8
use ekinhbayar\GitAmp\Presentation\Sound\BaseSound;
9
10
class BaseEvent implements Event
11
{
12
    protected int $id;
0 ignored issues
show
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_STRING, expecting T_FUNCTION or T_CONST
Loading history...
13
14
    protected Type $type;
15
16
    protected Information $information;
17
18
    protected Ring $ring;
19
20
    protected BaseSound $sound;
21
22 23
    public function __construct(int $id, Type $type, Information $information, Ring $ring, BaseSound $sound)
23
    {
24 23
        $this->id          = $id;
25 23
        $this->type        = $type;
26 23
        $this->information = $information;
27 23
        $this->ring        = $ring;
28 23
        $this->sound       = $sound;
29
    }
30
31 21
    public function getAsArray(): array
32
    {
33
        return [
34 21
            'id'          => $this->id,
35 21
            'type'        => $this->type->getValue(),
36 21
            'information' => $this->information->getAsArray(),
37 21
            'ring'        => $this->ring->getAsArray(),
38 21
            'sound'       => $this->sound->getAsArray(),
39
        ];
40
    }
41
}
42