Completed
Push — master ( cd32be...af1aac )
by Julián
05:54
created

ReceivedEvent::getMetadata()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * event-async (https://github.com/phpgears/event-async).
5
 * Async decorator for Event bus.
6
 *
7
 * @license MIT
8
 * @link https://github.com/phpgears/event-async
9
 * @author Julián Gutiérrez <[email protected]>
10
 */
11
12
declare(strict_types=1);
13
14
namespace Gears\Event\Async;
15
16
use Gears\Event\Async\Exception\ReceivedEventException;
17
use Gears\Event\Event;
18
19
final class ReceivedEvent implements Event
20
{
21
    /**
22
     * @var Event
23
     */
24
    private $originalEvent;
25
26
    /**
27
     * ReceivedEvent constructor.
28
     *
29
     * @param Event $originalEvent
30
     */
31
    public function __construct(Event $originalEvent)
32
    {
33
        $this->originalEvent = $originalEvent;
34
    }
35
36
    /**
37
     * Get original event.
38
     *
39
     * @return Event
40
     */
41
    public function getOriginalEvent(): Event
42
    {
43
        return $this->originalEvent;
44
    }
45
46
    /**
47
     * {@inheritdoc}
48
     *
49
     * @throws ReceivedEventException
50
     */
51
    public function has(string $parameter): bool
52
    {
53
        throw new ReceivedEventException(\sprintf('Method %s should not be called ', __METHOD__));
54
    }
55
56
    /**
57
     * {@inheritdoc}
58
     *
59
     * @throws ReceivedEventException
60
     *
61
     * @return mixed
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use NoType.

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
62
     */
63
    public function get(string $parameter)
64
    {
65
        throw new ReceivedEventException(\sprintf('Method %s should not be called ', __METHOD__));
66
    }
67
68
    /**
69
     * {@inheritdoc}
70
     *
71
     * @throws ReceivedEventException
72
     *
73
     * @return array<string, mixed>
0 ignored issues
show
Documentation introduced by
The doc-type array<string, could not be parsed: Expected ">" at position 5, but found "end of type". (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
74
     */
75
    public function getPayload(): array
76
    {
77
        throw new ReceivedEventException(\sprintf('Method %s should not be called ', __METHOD__));
78
    }
79
80
    /**
81
     * {@inheritdoc}
82
     *
83
     * @throws ReceivedEventException
84
     *
85
     * @return array<string, mixed>
0 ignored issues
show
Documentation introduced by
The doc-type array<string, could not be parsed: Expected ">" at position 5, but found "end of type". (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
86
     */
87
    public function getMetadata(): array
88
    {
89
        throw new ReceivedEventException(\sprintf('Method %s should not be called ', __METHOD__));
90
    }
91
92
    /**
93
     * {@inheritdoc}
94
     *
95
     * @throws ReceivedEventException
96
     *
97
     * @return array<string, mixed>
0 ignored issues
show
Documentation introduced by
The doc-type array<string, could not be parsed: Expected ">" at position 5, but found "end of type". (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
98
     */
99
    public function withMetadata(array $metadata)
100
    {
101
        throw new ReceivedEventException(\sprintf('Method %s should not be called ', __METHOD__));
102
    }
103
104
    /**
105
     * {@inheritdoc}
106
     *
107
     * @throws ReceivedEventException
108
     */
109
    public function getCreatedAt(): \DateTimeImmutable
110
    {
111
        throw new ReceivedEventException(\sprintf('Method %s should not be called ', __METHOD__));
112
    }
113
114
    /**
115
     * {@inheritdoc}
116
     *
117
     * @throws ReceivedEventException
118
     */
119
    public static function reconstitute(array $payload, array $attributes = []): void
120
    {
121
        throw new ReceivedEventException(\sprintf('Method %s should not be called ', __METHOD__));
122
    }
123
}
124