Completed
Push — master ( ae5fca...d9758b )
by Julien
13s
created

ReplyCommand::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
4
namespace TheAentMachine\Command;
5
6
use TheAentMachine\ReplyAggregator;
7
8
/**
9
 * A special command that is used to receive replies from a dispatch
10
 */
11
class ReplyCommand extends EventCommand
12
{
13
    private $replyAggregator;
14
15
    public function __construct(ReplyAggregator $replyAggregator)
16
    {
17
        parent::__construct();
18
        $this->replyAggregator = $replyAggregator;
19
    }
20
21
    protected function configure()
22
    {
23
        parent::configure();
24
        $this->setHidden(true);
25
    }
26
27
    protected function getEventName(): string
28
    {
29
        return 'reply';
30
    }
31
32
    protected function executeEvent(?string $payload): ?string
33
    {
34
        $this->replyAggregator->storeReply($payload);
0 ignored issues
show
Bug introduced by
It seems like $payload can also be of type null; however, parameter $payload of TheAentMachine\ReplyAggregator::storeReply() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

34
        $this->replyAggregator->storeReply(/** @scrutinizer ignore-type */ $payload);
Loading history...
35
        return null;
36
    }
37
}
38