Total Complexity | 7 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Coverage | 33.33% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | trait EnvelopeTrait |
||
8 | { |
||
9 | private MessageInterface $message; |
||
10 | |||
11 | public function getMessage(): MessageInterface |
||
12 | { |
||
13 | return $this->message; |
||
14 | } |
||
15 | |||
16 | public function withMessage(MessageInterface $message): self |
||
22 | } |
||
23 | |||
24 | 7 | public function getHandlerName(): string |
|
25 | { |
||
26 | 7 | return $this->message->getHandlerName(); |
|
27 | } |
||
28 | |||
29 | 1 | public function getData(): mixed |
|
32 | } |
||
33 | |||
34 | public static function fromMessage(MessageInterface $message): self |
||
35 | { |
||
36 | return new static($message); |
||
|
|||
37 | } |
||
38 | public function getMetadata(): array |
||
46 | ]); |
||
47 | } |
||
48 | |||
49 | public function getEnvelopeMetadata(): array |
||
52 | } |
||
53 | } |
||
54 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.