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

VoidCommand   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A executeEvent() 0 5 1
A configure() 0 4 1
A getEventName() 0 3 1
1
<?php
2
3
4
namespace TheAentMachine\Command;
5
6
/**
7
 * A command that does nothing
8
 */
9
class VoidCommand extends EventCommand
10
{
11
    protected function configure()
12
    {
13
        parent::configure();
14
        $this->setHidden(true);
15
    }
16
17
    protected function getEventName(): string
18
    {
19
        return 'void';
20
    }
21
22
    protected function executeEvent(?string $payload): ?string
23
    {
24
        // Let's do nothing.
25
        $this->log->debug('Event cannot be handled. Ignoring.');
26
        return null;
27
    }
28
}
29